diff --git a/src/game.js b/src/game.js index ef02aae..fe5743e 100644 --- a/src/game.js +++ b/src/game.js @@ -1,23 +1,22 @@ -window.onload = function() { - var game = new Phaser.Game( - 800, - 800, - Phaser.AUTO, - '', - { preload: preload, create: create }); +var game = new Phaser.Game(800, 600, Phaser.AUTO, ''); - function preload(){ +game.state.add('play', { + preload: function(){ game.load.image('pink', 'assets/pink.png'); game.load.image('green', 'assets/green.png'); game.load.image('grey', 'assets/grey.png'); game.load.image('blue', 'assets/blue.png'); console.log("preload"); - } - - function create(){ + }, + create: function(){ var alienSprite = game.add.sprite(450, 290, 'pink'); console.log(alienSprite); alienSprite.anchor.setTo(0.5, 0.5); + }, + render: function(){ + game.debug.text('Adventure Awaits!', 250, 40); } -}; \ No newline at end of file +}); + +game.state.start('play'); \ No newline at end of file