Real-time Games

If you want your game to work in real-time, set the realtime_interval tag in the prelude.

realtime_interval 0.5

The number indicates how long each realtime frame should be. In the above case, twice a second the game engine will tick, but with no input. Player input is processed as regular.

So, there are two sorts of ticks - one where the player has input, and then realtime ones - to tell them apart, you can search for this pattern.

(only triggers on real-time ticks)
[ stationary Player ] [ a ] -> [ Player ] [ b ] 

(only triggers in response to player input)
[ moving Player ] [ c ] -> [ moving Player ] [ d ] 

Because you're working on a realtime game, you might want to limit the speed at which a player can move - you can do this with the throttle_input prelude switch.


With this switch, if you press the same direction multiple times in rapid succession, you'll still move no more quickly than key_repeat_interval. You can still alternate directions quickly, and press action as quickly as you like.

A small note on the interaction of realtime and again:

If again is triggered, no realtime ticks will happen until the again stuff has finished.