Workshop › Angry Birds-style Slingshot › Step 15 of 47
While the bird flies, the sling should be empty: the pulled-back bird and the band are drawn only while aiming.
```js
if (state === 'aiming') {
const bx = SLING.x - Math.cos(aim.angle) * aim.pull * 0.5
...
ctx.arc(bx, by, BIRD, 0, Math.PI * 2)
ctx.fill()
}
```{ and } runs only when the state is 'aiming'.Wrap the lines from const bx = ... down to the bird's ctx.fill() in if (state === 'aiming') { ... }.
Skills: Game states
← Aiming or flying Gone off the screen →