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

Game Timer #14

Open
4 tasks
jugglinmike opened this issue Sep 25, 2014 · 0 comments
Open
4 tasks

Game Timer #14

jugglinmike opened this issue Sep 25, 2014 · 0 comments
Milestone

Comments

@jugglinmike
Copy link
Collaborator

According to the specification, the game should end after 1 or 2 minutes. We'll
get into game "screens" later on, but for now, let's make sure the moles stop
appearing and print the score.

  • director.js
    • Define an endGame method on the Director prototype
    • Print the player performance information (whacCount and
      escapeCount) to the developer's console in the endGame method. You can
      use the console.log method to do this.
    • Hide all the moles (only if they are currently visible). Make sure that
      they don't get scheduled to automatically show themselves again!
    • Update the Director constructor to schedule the endGame method to
      be invoked in one or two minutes (remember: use setTimeout)

Playing through a couple times, you may notice that some moles sometimes pop
up after the game is supposed to be over. Do you know why that is? Can you fix
it?

(This is a tricky one, so here's a hint: clearTimeout is a global function
that lets you cancel code you have already scheduled to run with setTimeout.
Read the docs on MDN for more info.)

@jugglinmike jugglinmike modified the milestone: Game state 1 Sep 25, 2014
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