Workshop › Lunar Lander › Step 25 of 31
After a landing, Space goes to the next level and keeps the score. After a crash, the game starts over.
```js
// After a landing, the next level; after a crash, a new game.
function next() {
if (state === 'landed') {
level += 1
startLevel()
} else if (state === 'crashed') {
reset()
}
}
ctx.fillText('Landed! Space: next level', canvas.width / 2, 140)
ctx.fillText('Crashed. Space: new game', canvas.width / 2, 140)
```else if checks a second condition only when the first was false: after a crash, reset() starts a new game.next as shown and write the comment above it.draw, change the two messages.Skills: Game states