Hi, I am working on the Simon game project. I need to be able to turn the game on and off. When the game is off it needs to totally reset everything, and I have done that for the most part, but sometimes the lights continue to flash and won’t stop if I happen to hit stop in the middle of a flash on the second turn or so if there are more flashes after it. To replicate my issue turn the game on. hit start. copy the moves correctly and get to the third round. on the fourth round turn the game off in the middle of the flash on the third round. Then turn it back on and you will see. I have the same problem when I try to hit start in the middle of a flash. The start button needs to act as a reset button that will start a new game without turning the game off and back on. I added a console.log(game.pc) on line 101, and that is showing me that my setInterval() starts running continuously once the off button is hit and I don’t know what to do about this.
Start button code starts on line 137 Computer move code starts on line 91 On button line 66 Clear All line 38
Thanks for checking this out I really appreciate it.