Business Outfitted Bob - wall collision detection

Hello, I am doing the challenge Business Outfitted Bob and for some reason the collision detection for the walls isn’t working. Here is the code:

    // Add variables that store the x and y coordinates of the Bob sprite
    let bobXCoord = gameState.player.X;    
    let bobYCoord = gameState.player.Y;

    // Add code to check collision between Bob and edges of the canvas of the game
    if (bobXCoord <= 32 || bobXCoord >= 448) {
      this.endGame();
    }

    if (bobYCoord <= 32 || bobYCoord >= 568) {
      this.endGame();
    }

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.