Chore Doors open door images not loading

In the Chore Door project, my open door images have stopped loading. I have completed up to Step#57. The images stopped loading sometime in the past few steps, before that it was working fine. I’ve seen similar questions in the forum, but the solutions given there did not seem to apply to me. I’ve watched the video, checked my code against all the hints, and can’t find where I went wrong. If anyone sees any issue in my code, I would very much appreciate some help. Thanks in advance!

let doorImage1 = document.getElementById('door1');
let doorImage2 = document.getElementById('door2');
let doorImage3 = document.getElementById('door3');
let startButton = document.getElementById('start');

let botDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/robot.svg';
let beachDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/beach.svg';
let spaceDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/space.svg';
let closedDoorPath = 'https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/closed_door.svg';

let numClosedDoors = 3;
let openDoor1;
let openDoor2;
let openDoor3;

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

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

const playDoor = () => {
  numClosedDoors--;
  if (numClosedDoors === 0) {
      gameOver('win');
};
  
door1.onclick = () => {
  if (!isClicked(doorImage1)) {
    doorImage1.src = openDoor1;
 		playDoor();
  }
};
door2.onclick = () => {
  if (!isClicked(doorImage2)) {
    doorImage2.src = openDoor2;
  	playDoor();
  }
};
door3.onclick = () => {
  if (!isClicked(doorImage3)) {
    doorImage3.src = openDoor3;
  	playDoor();
  }
};

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

randomChoreDoorGenerator();




1 Like

Missing RBRACE on if body.

Sorry for the silly mistake, but thank you so much!!

1 Like