Loop

Loop

new Loop(cb, tps, autostart)

Source:

Basic game loop, cb is called tps times (ticks per second)

Beware This is just a basic setTimeout based loop. Due to how setTimeout is implemented in node.js this can be very inaccurate. If you need a more precise timing, use PreciseLoop

Parameters:
Name Type Default Description
cb function
tps Number
autostart Boolean true

Members

lasttick

Source:

ms timestamp of the last time

Methods

start()

Source:

start the loop

stop()

Source:

stop the loop