Learn with tiles › 18
Is a key held down?
Move smoothly while a key is held down.
1
"when key pressed" runs only once, at the moment you press. So the movement is jerky.
The key (key) pressed? tile is true while you hold that key down. If you ask inside "forever", Lara moves smoothly for as long as you hold the key.
To do While the → key is held down, move right by 4 each time.
Loading tiles…
2
Now make the left side too. Just place one more "if" tile. On every pass, the two if tiles are asked one after the other.
The new "key pressed?" tile is set to → right. Tap the key slot and change it to ← left.
To do While the ← key is held down, move left by 4 each time.
Loading tiles…