Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons can be clicked when game is not started or game is over! #7

Open
445h1f opened this issue Oct 26, 2022 · 0 comments
Open

Buttons can be clicked when game is not started or game is over! #7

445h1f opened this issue Oct 26, 2022 · 0 comments

Comments

@445h1f
Copy link

445h1f commented Oct 26, 2022

Fix:
Checking if started is true in btn click event!

$(".btn").click(function() {
  if (started) {
    var userChosenColour = $(this).attr("id");
    userClickedPattern.push(userChosenColour);

    playSound(userChosenColour);
    animatePress(userChosenColour);

    checkAnswer(userClickedPattern.length-1);

  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant