プレイ日記
komodo † 406mario
so how would i make it so if i push the "a" button at just the right time i can get a more powerful move like in all the mario rpgs?
2そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
Well, since it involves waiting for the right moment, you could have a timer loop that accepts input, and you'd code the damage output depending on the time passed. It'd look something like this... 'THE VARIABLE 'T' REPRESENTS TIME PASSED IN FRAMES FOR T=0 TO 120 'WAIT 2 SECONDS AT MOST IF BUTTON() AND #A THEN BREAK 'EXIT WAIT LOOP WHEN USER PRESSES A WAIT 1 'WAIT UNTIL NEXT FRAME NEXT
0そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
(Continued from previous comment) IF T>55 && T<65 THEN 'IF USER PRESSED A AT AROUND 1 SECOND DAMAGE=10 'DO MORE DAMAGE ELSE DAMAGE=5 ENDIF
0そうだね
プレイ済み
返信[3]
親投稿
Minxrod³ Minxrod
Use MAINCNT, MILLISEC, or VSYNC instead of WAIT, they are better, made specifically for things like timing.
1そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
You're right! I made my code on a bit of a hurry, sorry! If you want to use VSYNC, simply replace WAIT 1 in the above code with a VSYNC 1. If you want to use MILLISEC, you could replace the whole loop with something a bit simpler, like this... T0=MILLISEC REPEAT T1=MILLISEC UNTIL BUTTON() AND #A T=T1-T0 Where T would be the time passed in milliseconds. T0 and T1 are used as auxiliaries.
0そうだね
プレイ済み
返信[5]
親投稿
komodo † 406mario
interesting i thought of somthing very similar to that while at work I think I might do somthing like that.
0そうだね
プレイ済み