A module for running animation and game loops with browserify.
You've probably heard of
helpful method for running animations at higher frame rates than
It works really well for rendering animations to the screen, adjusting the
speed to fit your screen refresh rate and battery life, etc.
Unfortunately it's not predictable - it tends to fluctuate quite a bit, and leaves you with results either far too fast or too slow depending on the device. You could use setInterval, but that can be unreliable too. Keeping track of delta time is a good solution, but it too can behave differently depending on the frame rate.
So ticker handles running your update loop at a more consistent rate - either speeding it up or slowing it down in response to performance, this way.
npm install ticker
ticker = require('ticker')(element, framerate, skips)
Creates a new ticker instance.
elementshould either be
windowor the canvas element you're drawing to.
framerateis the number of frames per second you'd like to tick, and defaults to 60.
skipsis the maximum frames you'd like to skip per render. Defaults to 1. Set to 0 to disable entirely.
Emitted for every frame of logic you should to run.
Emitted for every draw call you should run.
var ticker =canvas = documentctx = canvasx = 0y = 0