Last active
October 15, 2016 09:36
-
-
Save caroparo/a868810b3cc90099e16806a7feef9e6f to your computer and use it in GitHub Desktop.
nonsensical Phaser helpers
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
function addSprite(name, x, y) | |
{ | |
var sprite = game.add.sprite(0, 0, name); | |
// centered | |
sprite.pivot.x = sprite.width * 0.5; | |
sprite.pivot.y = sprite.height * 0.5; | |
sprite.position.x = x; | |
sprite.position.y = y; | |
return sprite; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment