Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

error states


mrxj88
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...