kd Class
Methods
run
(
-
handler
A basic run loop. handler
gets called approximately 60 times a second.
Parameters:
-
handler
Function(number, number)The callback function to call on every tick. You likely want to call kd.tick in this function. This callback receives the time elapsed since the previous execution of the callback as the first parameter, and the current time stamp as the second.
tick
()
Evaluate which keys are held down and invoke their handler functions.