Workshop › Asteroids › Step 26 of 41
The player has 3 lives. crash takes one away and puts the ship back in the middle, still, facing up.
```js
let lives
lives = 3
function crash() {
lives -= 1
resetShip()
}
```lives starts at 3. crash subtracts one and resets the ship.let score write let lives; at the bottom, under score = 0, write lives = 3.keydown listener write crash, followed by an empty line.Skills: Game states
← Show the score A rock hits the ship →