diff options
Diffstat (limited to 'templates/_main.js.tpl')
-rw-r--r-- | templates/_main.js.tpl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/_main.js.tpl b/templates/_main.js.tpl new file mode 100644 index 0000000..0b1ddb9 --- /dev/null +++ b/templates/_main.js.tpl @@ -0,0 +1,12 @@ +'use strict'; + +//global variables +window.onload = function () { + var game = new Phaser.Game(<%= gameWidth %>, <%= gameHeight %>, Phaser.AUTO, '<%= _.slugify(projectName) %>'); + + // Game States + <% _.forEach(gameStates, function(gameState) { %>game.state.add('<%= gameState.shortName %>', require('./states/<%= gameState.shortName %>')); + <% }); %> + + game.state.start('boot'); +};
\ No newline at end of file |