mrxj88 Posted January 11, 2017 Share Posted January 11, 2017 I get a error saying main.js:9 Uncaught SyntaxError: missing ) after argument list.. Not sure what im doing wrong here. Heres my code var Menu = { preload: function() { game.load.image('menu', '/images/menu.png') }, create: function() { this.add.button(0, 0, 'menu', this.startGame, this); }, startGame: function() { this.state.start('Game'); }, }; Link to comment Share on other sites More sharing options...
Get_Bentley Posted January 11, 2017 Share Posted January 11, 2017 The only issue I can see at first glance in your code is you are missing a semi colon in the proload function after game.load.image. Should be : game.load.image('menu', '/images/menu.png') Not sure because I havent actually tested the code but this could possibly be it. If you would like to describe exactly which line is throwing the error may be easier to help you debug. Let me know if this helps! Link to comment Share on other sites More sharing options...
espace Posted January 11, 2017 Share Posted January 11, 2017 could you identify precisely the line 9 in your main.js ? Link to comment Share on other sites More sharing options...
mrxj88 Posted January 11, 2017 Author Share Posted January 11, 2017 hey guys thanks for the quick replies. line 9 is :this.add.button(0, 0, 'menu', this.startGame, this); Link to comment Share on other sites More sharing options...
mrxj88 Posted January 11, 2017 Author Share Posted January 11, 2017 oh jeezz i figured out what was wrong. it has a typo. Thanks tho! Link to comment Share on other sites More sharing options...
Théo Sabattié Posted January 11, 2017 Share Posted January 11, 2017 1 hour ago, mrxj88 said: startGame: function() { this.state.start('Game'); }, remove ',' at the end Link to comment Share on other sites More sharing options...
Recommended Posts