Created
August 5, 2014 21:38
-
-
Save pr00thmatic/127362bceb68c198b076 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
cursores = game.input.keyboard.createCursorKeys(); | |
if(cursores.left.isDown) { | |
... | |
} else if (cursores.right.isDown) { | |
... | |
} else if (cursores.up.isDown) { | |
uno.body.velocity.y = -1; | |
uno.animations.play('front') | |
lastDirection = 'front'; | |
} else if (cursores.down.isDown) { | |
uno.body.velocity.y = 1; | |
uno.animations.play('back'); | |
lastDirection = 'back'; | |
} else { | |
uno.body.velocity.x = 0; | |
uno.body.velocity.y = 0; | |
uno.animations.play('stand_' + lastDirection); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment