Workshop › Simon Says Colors › Step 20 of 27
The message now shows how far you are, Your turn: 2/5, and Wrong! Click to retry when the game is over.
```js
let message = state === 'showing' ? 'Watch...' : 'Your turn: ' + inputAt + '/' + sequence.length
if (state === 'over') message = 'Wrong! Click to retry'
ctx.fillText(message, canvas.width - 10, 27)
```message is picked first, then replaced if the game is over, then written.'Your turn: ' + inputAt + '/' + sequence.length glues four parts: 'Your turn: 2/5'.In draw, replace the last fillText line with the three new lines.
Skills: Game states
← Play with the mouse A function for a new game →