Workshop › Angry Birds-style Slingshot › Step 46 of 47
The panel should say what Space will do: go to the next level, play again after the last one, or try again after a
loss. A ?: inside another ?: picks one of three texts.
```js
const last = level === LEVELS.length - 1
ctx.fillText(state === 'won' ? (last ? 'All levels cleared!' : 'Level cleared!') : 'Out of birds', canvas.width / 2, 145)
ctx.font = '15px sans-serif'
ctx.fillText(state === 'won' ? (last ? 'Space or tap to play again' : 'Space or tap for the next level') : 'Space or tap to try again', canvas.width / 2, 172)
```last is true on the last level.state === 'won' ? (last ? A : B) : C first asks "won?", then, only if so, "last level?".In the panel, write the last line under the bold font line and change both fillText lines as shown.
Skills: Drawing on a canvas
← The best score Build it yourself: the yellow bird →