Skip to content

Instantly share code, notes, and snippets.

@ryanhallcs
Created March 15, 2017 15:49
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 ryanhallcs/4a3f891276e9d688986df340cb9e2066 to your computer and use it in GitHub Desktop.
Save ryanhallcs/4a3f891276e9d688986df340cb9e2066 to your computer and use it in GitHub Desktop.
Phaser Hello World game
window.onload = function() {
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'gameCanvas', { preload: preload, create: create });
function preload () {
game.load.image('logo', 'assets/phaser.png');
}
function create () {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo');
logo.anchor.setTo(0.5, 0.5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment