Jump to content

Uncaught ReferenceError: Invalid left-hand side in assignment


nb0yc33
 Share

Recommended Posts

I don't know what's wrong with this function - it produces an invalid left-hand side error. Please note bombs is a group so I want this function to run whenever the user's x and y coordinates are similar to any of the sprites in the bombs group. It'd be great if anyone could help

 

 

 

bombTimerCountdown: function() {
    
    if (user.body.x = bombs.body.x || user.body.x = bombs.body.x-10 || user.body.x =bombs.body.x+10){
        
        if (user.y = bombs.body.y || user.y = bombs.body.y-10 || user.y = bombs.body.y+10) {
            
            bombs.kill();
            user.kill();
            this.game.state.start(game.state.current);
            
            
        
         }
       }
        
    },

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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