can anyone enlighten me how to create a trigger loop
that starts when a specific key is held down, and stops when that key is released?
im kinda losing my edge right now.
ty any input apreciated
Offline
[blocks]
<when green flag clicked>
<forever>
<if><key[ (whatever key you want to trigger it) ]pressed?>
--Put here what you want to do while the key is pressed.
<else>
--Put here what you want to do when it is not pressed.
<end>
<end>
[/blocks]
OR
[blocks]
<when green flag clicked>
<forever>
<wait until> <key[ (whichever key you want) ]pressed?>
<repeat until> <not> <key[ (whichever key you want) ]pressed?> >>
--Stuff you wanna do while it's pressed
<end>
--Stuff you wanna do after the key is not pressed.
<end>
[/blocks]
Last edited by Kingdaro (2010-09-18 13:32:33)
Offline
Try:
Repeat until (Not(key pressed))
loop content
end repeat
Offline
well in that case i think i have found a bug in the program.
following trigger:
event: press O
condition: variable(X)=1
action: do blablabla
now, i have the state of the variable(x) indicated in the screen, and its 0.
however by pressing O the trigger is executed, ignoring the condition.
what could i possibly have overseen?
Offline
oh nevermind sry gods of scratch i missed a little block that was out of place messing up the entire chain of actions. ty for the help so far!
Offline