Business Outfitted Bob

https://www.codecademy.com/paths/create-video-games-with-phaser/tracks/game-dev-learn-javascript-basics/modules/game-dev-project-variables-and-conditionals/projects/business-outfitted-bob

I’m having an issue in this project where the game screen turns white while trying to run it. Specifically when adding the code in to define if X or Y state hits the game borders. The game runs fine until i put in this code.

if (bobXCoord <= 32 || >= 448){

  this.endGame();

} else if (bobYCoord <= 32 || >= 568 ){

  this.endGame();

}

In console it says on line 113 (being this top piece of code)
Uncaught SyntaxError: expected expression, got ‘>=’

I just don’t understand how i can fix this, it seems accurate and the other code i wrote seems to work fine until i put in this conditional statement to check if x or y hits the borders.

EDIT: Found the issue, i needed to add in the bobXCoord for the other option, did not know i had to do it for both.

if (bobXCoord <= 32 || bobXCoord >= 448){

  this.endGame();

}
1 Like