craftyjs/Crafty — Issue #228: Starting animation from AnimationEnd
Author: sorenbs
Created: 2012-03-01 21:45:27+00:00
State: open

It should be possible to start an animation from a function bound to AnimationEnd

player = Crafty.e("2D, Canvas, animator, SpriteAnimation")
.attr({x: 64, y: 64, z: 2})
.animate("level1", 0, 0, 5)
.animate("level2", 0, 1, 5)
.animate("level1", 30, 2)
player.bind("AnimationEnd",
function()
{
this.animate("level1",30, 5);
console.log("AnimationEnd");
});

http://jsfiddle.net/KD8q9/24/