Simon game timing help

Thought this one was gonna be easy compared to tictactoe, but having problems with timing. I think it basically works, but the problem is when the user makes an error, this timing goes wrong and it plays back the sounds very quickly. Anyone know what’s going on? Heres the link to my project.

See the Pen Simon Game by Richard (@0sumrich) on CodePen.

Hey 0sumrich,
I tried playing the Simon project you made several times and got different results each time I purposefully clicked the wrong button.
One time, it did repeat the sequence correctly, another it didn’t repeat at all.
It is kind of hard to follow your code to find where the bug is, but I would have to guess that once the user fails, you either forgot to reset some value / call some function that plays the sequence again.
One suggestion about a thing I noticed is that you are making the user press the same amount of buttons that the sequence is, even though the user might have clicked the wrong button at any time in the sequence. What I mean is, if the current sequence is 3 and the user pressed the first wrong button, he/she will have to continue pressing buttons until they reach the sequence’s length and only then they will be notified that they are wrong.

Hope that helps.

Hey thanks for checking it out. I see what you mean about the error sequence - think that was just the first thing I thought of but never went back to check it out. Anyway, I’ll go back and check it out and see if I can spot any other bugs after that.

Several months later, decided to try and fix this today, been doing other projects, but I think I’ve ironed out most of the bugs. Just need to make it winnable now.

https://0sumrich.github.io/simongame/