Workshop › Whack-a-Mole › Step 15 of 18
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()
```1000 - 500 * progress() is 1000 at the start, 750 halfway and 500 at the end: a straight line between the two.update uses these functions instead of the fixed numbers.progress, write the comment, upTime and popGap.update, replace 1000 with upTime() and 700 with popGap().Skills: Game states, Functions
← How far into the round? Remember each hit →