Created
May 24, 2017 15:36
-
-
Save leifjones/507ae20d6dd020249d96bbd79fc2d12a to your computer and use it in GitHub Desktop.
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
// Create our 'main' state that will contain the game | |
var mainState = { | |
preload: function() { | |
// This function will be executed at the beginning | |
// That's where we load the images and sounds | |
}, | |
create: function() { | |
// This function is called after the preload function | |
// Here we set up the game, display sprites, etc. | |
}, | |
update: function() { | |
// This function is called 60 times per second | |
// It contains the game's logic | |
}, | |
}; | |
// Initialize Phaser, and create a 400px by 490px game | |
var game = new Phaser.Game(400, 490); | |
// Add the 'mainState' and call it 'main' | |
game.state.add('main', mainState); | |
// Start the state to actually start the game | |
game.state.start('main'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment