Chore Door project

https://www.codecademy.com/paths/web-development/tracks/build-interactive-websites/modules/web-dev-interactive-websites/projects/chore-door

I’m stuck :confused: When I open all doors, the button should change the text from “good luck” to “you win…” but it doesn’t change. I think I did everything according to instructions and I can’t find where is the mistake. Could you please help?

const botDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/robot.svg';

const beachDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/beach.svg';

const spaceDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/space.svg';

const numClosedDoors = 3;

let openDoor1;
let openDoor2;
let openDoor3;

const closedDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/closed_door.svg';

let startButton = document.getElementById('start');

const isClicked = (door) => {
  if (door.src === closedDoorPath) {
    return false;
  }
  else {
    return true;
  }
}

const playDoor = () => {
  numClosedDoors--;
  if (numClosedDoors === 0) {
    gameOver('win');
  }
}

const randomChoreDoorGenerator = () => {
  let choreDoor = Math.floor(Math.random() * numClosedDoors);
  if (choreDoor === 0) {
    openDoor1 = botDoorPath;
    openDoor2 = beachDoorPath;
    openDoor3 = spaceDoorPath;
  }
  else if (choreDoor === 1) {
    openDoor2 = botDoorPath;
    openDoor1 = beachDoorPath;
    openDoor3 = spaceDoorPath;
  }
  else {
    openDoor3 = botDoorPath;
    openDoor1 = beachDoorPath;
    openDoor2 = spaceDoorPath;
  }
}

let doorImage1 = document.getElementById('door1');

doorImage1.onclick = () => {
  if(!isClicked(doorImage1)) {
    doorImage1.src = openDoor1;
    playDoor();
  }
}

let doorImage2 = document.getElementById('door2');

doorImage2.onclick = () => {
  if(!isClicked(doorImage2)) {
   doorImage2.src = openDoor2;
   playDoor();    
  }
}

let doorImage3 = document.getElementById('door3');

doorImage3.onclick = () => {
  if(!isClicked(doorImage3)) {
   doorImage3.src = openDoor3;
   playDoor();    
  }
}

const gameOver = (status) => {
  if (status === 'win') {
    startButton.innerHTML = 'You win! Play again?';
  }
}

randomChoreDoorGenerator();

and in html file I have:

   <div id="start" class="start-row">Good luck!</div>

I’m having a similar problem but I noticed you will only receive the message “You win play again” the very first time the page is manually refreshed and you are able to open final door and the chore bot appears there. Any other time you go through this steps I always get Game over! Play again?

Here is my codepen if anybody is willing to provide some feedback on this. Chore Door Project