Let’s discuss your “Simon Game"

Hello everyone
I’m currently finishing my Front End Projects, but unfortunately got stuck with some issues in my “Simon”.

  • sound loop bug
    I noticed that when I click quickly start button twice, the sound starts looping, and I can’t find why. It’s the play() function’s loop going on, but I can’t prevent it.

  • graphical bug
    Silly thing, but I can’t get rid of annoying lines of underneath colors visible in my game, near the horizontal and vertical lines. Tried different solutions, but it always looks like this

  • quality code
    I can see that my code is a spaghetti. I know basics of Functional and OO programming, but can’t implement them. How can I start?

here’s my Pen:

Do you want to be able to click the Start button twice quickly and if the sound has not started, then it should not play at all?

If so, then you need to check that game is true inside the following setInterval callback function before calling makeNoise(computerColors[index]);


Also, if game is false, you should go ahead and clear the interval too.