Skip to content

Instantly share code, notes, and snippets.

@caroparo
Last active October 15, 2016 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caroparo/a868810b3cc90099e16806a7feef9e6f to your computer and use it in GitHub Desktop.
Save caroparo/a868810b3cc90099e16806a7feef9e6f to your computer and use it in GitHub Desktop.
nonsensical Phaser helpers
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