Created
April 11, 2014 18:52
-
-
Save ada-lovecraft/10491955 to your computer and use it in GitHub Desktop.
Animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sprite = game.add.sprite(x, y, 'spriteSheet'); | |
sprite.animations.add('idle', [3]); | |
var spriteAnimation = sprite.animations.add('jump', [0,1,2,3,2,1]); | |
spriteAnimation.onComplete.add(animationStopped, this); | |
sprite.play('jump'); | |
function animationStopped() { | |
sprite.play('idle') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment