Changing animationFrame code to instead hook into Crafty's own timer function