Simon Game help requested

Simon Game help requested
0.0 0

#1

I finally reached a point where I’m stuck. The console is throwing no errors, and the code looks good to me, but I’m obviously missing something. If anyone could take a look and give some suggestions as to what I’m missing, it would be much appreciated. As a note, I still have not implemented strict mode.

Here is the link to my CodePen: https://codepen.io/mcmcconn/pen/KqyzZp

Thanks!


#2

I haven’t looked through all the code but it looks like the start button ends up calling the reset function. I did a console.log in this function and it shows up in the console.


#3

One of the main issues I am seeing if that when you click start, your app submits the form which refreshes your page. Two solutions:

  • remove the form since it isn’t needed

or

  • prevent the form from submitting:
$("form").submit(function(e){
    e.preventDefault();
  });

#4

I noticed that as well after you pointed it out. Looks like I need to add more spacing between the buttons to get rid of some overlap (10px to margin-top does it). If I click on the top of the Start button, it’ll register as start.


#5

I went ahead and removed it. Not sure what my thought process was in adding it to the page.