Workshop › Missile Command-style Defense › Step 26 of 35
Each wave is harder
What we are doing
Later waves should be harder: missiles fly faster and come closer together, but never less than 20 frames apart.
```js
incoming.push({ sx, sy: 0, x: sx, y: 0, tx, ty: GROUND, speed: 0.5 + wave * 0.15 })
launchIn = Math.max(20, 70 - wave * 6)
```
What it means
- The speed is 0.65 in wave 1, 0.8 in wave 2, 0.95 in wave 3...
- The gap is 64 frames in wave 1, 58 in wave 2...;
Math.max(20, ...) never lets it go below 20.
Your turn
- In
launch, replace speed: 0.8 with speed: 0.5 + wave * 0.15.
- In
update, replace launchIn = 60 with the Math.max line.
Skills: Game states
← Waves The end of a wave →
All steps
- Six cities to protect
- Your missile base
- Draw again and again
- Cities that can fall
- Rubble
- Move towards a point
- Launch an enemy missile
- One missile a second
- Missiles on their way
- Smoke trails
- Impact
- Fire an interceptor
- Click the sky
- Interceptors fly
- An explosion that grows and shrinks
- Explode on arrival
- Draw the explosions
- Impacts explode too
- Caught in the blast
- Chain reactions
- Only your explosions count
- Points for every missile
- Show the score
- Limited ammo
- Waves
- Each wave is harder
- The end of a wave
- The end
- Play again
- Wave, ammo and messages
- Launch from anywhere
- Some missiles will split
- Split into three
- A high score
- Build it yourself: a crosshair