API Docs for: 1.0.1

Grape.GameLoop Class

A class which serves as a loop. It uses requestAnimationFrame if possible. It tries to execute the game.frame() game.getRequiredFps() times a second. The game.render() method will be executed 0 or 1 times in each animation frame, depending on the game.frame() was executed at least once or not.

Constructor

Grape.GameLoop

(
  • game
)

Parameters:

  • game Grape.Game

    the game for frame(), render() and getRequiredFps() calls

Item Index

Methods

Methods

isRunning

() Boolean

Tells whether the game loop is running or not.

Returns:

Boolean:

true, if running

start

()

Starts the game loop.

stop

()

Stops the game loop