Workshop › Pong › Step 23 of 26
Long rallies get exciting when the ball speeds up: every hit makes it 5% faster, up to a limit of 12.
```js
const speed = Math.min(Math.abs(ball.vx) * 1.05, 12)
```* 1.05 makes the speed 5% bigger each hit.Math.min(..., 12) takes the smaller of the two, so the speed never goes past 12.In bounceOff, change the speed line.
Skills: Velocity and gravity
← Aim with the paddle A computer opponent →