Workshop › Breakout › Step 23 of 39
launch() sends the waiting ball off: the state becomes 'playing' and the ball gets its velocity. It only works
while serving.
```js
function launch() {
if (state !== 'serve') return
state = 'playing'
ball.vx = 3
ball.vy = -4
}
```!== means "is not equal". If we are not serving, return leaves at once and nothing happens.'playing' and the ball gets the velocity it used to start with.Leave an empty line under resetBall and write launch.
Skills: Game states
← Ride along with the paddle Click or press Space →