Workshop › Whack-a-Mole › Step 15 of 18

Faster and faster

What we are doing

As the round goes on, moles stay up for less time (1000 ms down to 500) and come more often (every 700 ms down to 350).

```js
// Linear interpolation from the easy value to the hard value as the round goes on.
function upTime() {
  return 1000 - 500 * progress()
}

function popGap() {
  return 700 - 350 * progress()
}

      hole.upUntil = now + upTime()
    nextPop = now + popGap()
```

What it means

Your turn

  1. Under progress, write the comment, upTime and popGap.
  2. In update, replace 1000 with upTime() and 700 with popGap().

Skills: Game states, Functions

All steps

  1. A green field
  2. Nine holes
  3. Draw the holes
  4. A clock and a loop
  5. A mole in a hole
  6. Moles pop up
  7. Which hole was clicked?
  8. Whack!
  9. Show the score
  10. Click to start
  11. Time's running
  12. Time's up
  13. Best score
  14. How far into the round?
  15. Faster and faster
  16. Remember each hit
  17. Floating +1
  18. Build it yourself: combos