Input

When you press the arrow keys or action, this input is sent to the main player.

Sometimes you will want to have several player entities on screen at once. Don't worry, input gets sent to all of them :)

Sometimes you will want several different types of objects to be able to receive input. Let's call them Player1,Player2, Player3. You can define player as follows in the legend section

Player = Player1 or Player2 or Player3

and then three of those entity types will receive input from the player.

See kettle for an example of sending many inputs to many entities simultaneously.

My old game seems to move much more quickly than it used to...

There was a bug in older versions of PuzzleScript that resulted in different browsers running input repeat at different rate (fixed here in 2022). The fix made the timing consistent between browsers, but it means if you tuned your game for firefox that it might be too snappy now if you re-export it or tried out a shared link. I try very hard to not break or change the behaviour of existing puzzlescript games, but this is one of those cases where it was broken anyway in some browsers, and it's worth bringing things into harmony.

Another problem is puzzlescript has gotten much faster over the years, and some older games just yoloed it and set key_repeat_interval to 0.00001 or whatever. Now this hubris is being pushed! Pls pick the speed that you want for your game. ^^

To adjust held-key speed, set key_repeat_interval in the prelude. Its default is 0.15 seconds; a larger value, such as key_repeat_interval 0.2, repeats more slowly. For timed rules, adjust realtime_interval or again_interval as appropriate. Test the result in the browsers you want to support.