Workshop › Pinball › Step 15 of 42
A ball that falls out of the bottom is lost; a new one waits in the lane. A weak launch can also roll back down the lane: once it rests there, it waits to be launched again.
```js
// A ball that rolled back down the lane waits to be launched again.
if (ball.x > 360 && ball.y > 550 && Math.hypot(ball.vx, ball.vy) < 0.5) newBall()
if (ball.y > canvas.height + R) newBall() // drained: the next ball
```x > 360), near its bottom (y > 550) and almost still (speed under 0.5).newBall(), which also sets 'ready' again.In update, at the end, under the speed limit's closing }, write the comment and the two lines.
Skills: Game states
← Ready or playing Three bumpers →