Workshop › Angry Birds-style Slingshot › Step 18 of 47
After 60 calm frames (one second), or as soon as the bird is off the right edge, the shot is over: the bird is removed and the sling is ready again.
```js
calm = moving ? 0 : calm + 1
if (calm < 60 && !(bird && bird.x > canvas.width)) return
if (bird) {
bodies = bodies.filter((b) => b !== bird)
bird = null
}
state = 'aiming'
}
```! means "not".bodies and forgotten, and we go back to aiming.In update, under calm = moving ? 0 : calm + 1, write the new lines.
Skills: Game states
← Wait for calm See the path before you shoot →