Skip to content

Instantly share code, notes, and snippets.

@joseph-montanez
Created May 28, 2011 03:26
Show Gist options
  • Save joseph-montanez/996561 to your computer and use it in GitHub Desktop.
Save joseph-montanez/996561 to your computer and use it in GitHub Desktop.
this.engine.addTexture("resources/grass.png");
this.engine.addTexture("resources/grass-tiles-2-small.png");
var player = new Darkcore.Sprite();
player.x += 32;
player.on_key_press = ((engine, sprite) => {
if (engine.keys.up) {
sprite.y += 4;
}
if (engine.keys.down) {
sprite.y -= 4;
}
if (engine.keys.left) {
sprite.x -= 4;
}
if (engine.keys.right) {
sprite.x += 4;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment