game-ticker
Implements a game loop where you can register update and render functions, to be supplied with time delatas and other information.
const end = require('game-ticker')({ update: () => {...}, render: () => {...}, updatesPerSecond, maxFPS})
Starts the game ticker. Returns a function to end it.
Takes the following options:
update
: The function to call every (1000 / updatesPerSecond) millisecondsrender
: The function to call after requestAnimationFrameupdatesPerSecond
: The number of desired updates per secondmaxFPS
: The maximum allowed FPS
Example:
const gameTicker = const end =