summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2014-04-21 12:37:58 +0200
committerJustin Worthe <justin.worthe@gmail.com>2014-04-21 12:37:58 +0200
commit73cf3921dab092c9e568a59d246b0a4c6ef8dffa (patch)
treea09aaa25cc418728dd38001a25e9fe90fb0a2aec
parent8de58b344fdb824e47c1d733d470e9e9cecf74f9 (diff)
Added missing template file used by Grunt build
-rw-r--r--templates/_main.js.tpl12
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