Workshop › Angry Birds-style Slingshot › Step 37 of 47
A puzzle needs a limit: three birds per level. birdsLeft starts at 3, each launch takes one, and with none left
launch does nothing.
```js
let birdsLeft
birdsLeft = 3
function launch() {
if (state !== 'aiming' || birdsLeft === 0) return
...
bodies.push(bird)
birdsLeft -= 1
```reset gives three birds.launch now also leaves when birdsLeft is 0 (|| means "or"), and takes one bird with -= 1.let bird write let birdsLeft; in reset, under bird = null, write birdsLeft = 3.launch, extend the first line with || birdsLeft === 0 and write birdsLeft -= 1 under bodies.push(bird).Skills: Game states