Workshop › Asteroids › Step 34 of 41
Every wave's rocks are 20% faster: the speed is multiplied by 1 + (wave - 1) * 0.2. Wave 1 is ×1, wave 3 ×1.4, wave 6
×2. A multiplier that grows with the wave is a simple, readable way to tune difficulty.
```js
// Smaller asteroids are faster, and every wave is 20% faster than the one before.
const speed = (0.6 + Math.random() * (4 - size) * 0.5) * (1 + (wave - 1) * 0.2)
```In makeAsteroid, replace the speed line with the comment and the new line.
Skills: Velocity and gravity, Game states
← The next wave One function to start →