<game-loop*> ( tick-interval-nanos tick-delegate draw-delegate -- loop )
Game loops

Prev:<game-loop> ( tick-interval-nanos delegate -- loop )
Next:start-loop ( loop -- )


tick-interval-nanosan integer
tick-delegatea Game loop delegate
draw-delegatea Game loop delegate

loopa game-loop

Word description
Constructs a new stopped game-loop object. When started, the game loop will call the tick* method on the tick-delegate every tick-interval-nanos nanoseconds, and draw* on the draw-delegate as frequently as possible. The start-loop and stop-loop words start and stop the game loop.

The <game-loop> word provides a shorthand for initializing a game loop that uses the same object for the tick-delegate and draw-delegate.

See also


: <game-loop*>
( tick-interval-nanos tick-delegate draw-delegate -- loop )
f 0 0 f f f game-loop boa ;