Created
May 27, 2011 19:39
-
-
Save joseph-montanez/995987 to your computer and use it in GitHub Desktop.
This makes me love Vala
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
this.player = new Darkcore.Sprite(); | |
this.player.on_key_press = ((a) => { | |
// We are able to retain scope yay! | |
if (this.keys.up) { | |
this.player.y += 4; | |
} | |
if (this.keys.down) { | |
this.player.y -= 4; | |
} | |
if (this.keys.left) { | |
this.player.x -= 4; | |
} | |
if (this.keys.right) { | |
this.player.x += 4; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment