Skip to content

Instantly share code, notes, and snippets.

@talentless
Created April 10, 2012 18:35
Show Gist options
  • Save talentless/2353548 to your computer and use it in GitHub Desktop.
Save talentless/2353548 to your computer and use it in GitHub Desktop.
// something similar to this
var lt = Date.now();
var step = function() { var nt = Date.now(); var dt = nt-lt; lt = nt; Crafty.trigger("Step", dt/1000); }
Crafty.bind("EnterFrame", step);
Crafty.bind("Step", function(dt) { /* Do Stuff Here */ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment