i have a game that requires that only a constant pressing of a button on the key board will activate the timer (in other words when i press the button it runs when i let go it stops) how can i do this?
Offline
The timer cannot be stopped, but here's a code that could help you:
[blocks]
<when green flag clicked>
<set{ Timer }to( 0 )>
<forever if><key[ T ]pressed?>
<change{ Timer }by( 1 )>
<wait( 1 )secsc>
<end>
[/blocks]
Does this help?
Offline
yes! it worked im creating a leval game and needed it because it needs to change levels when timer reaches certain number
Offline
i have onother problem. how can you have a sprite do something if it is within a certain distance of another
Offline
[blocks]
<when green flag clicked>
<forever>
<if><distance to[ Sprite ]>
<move( 10 )steps>
<end>
<end>
[/blocks]
Just replace Move 10 Steps with what you want it to do.
Offline
Thanks! ( You used BYOB ^.^ )
Offline
fg123 wrote:
Edit@Magnie:
http://img14.imageshack.us/img14/7681/scripts.gif
ahhh, but if it is a large sprite, the distance to has to be altered, remember, distance to is not the distance to the outside of a sprite, but to the centre
Offline
True True True. ^.^
Offline
Why not the timer be a variable?
Ex:
<{ Time (In Whatever) }>
You can stop a variable, riiight?
Offline
Offline