Workshop › Rhythm Lanes › Step 18 of 35
The player should see how a press went. feedback holds a message { text, color, time }; when there is one, draw
writes it big in the middle of the screen.
```js
let feedback // { text, color, time } shown for a moment
feedback = null
if (feedback) {
ctx.fillStyle = feedback.color
ctx.font = 'bold 28px sans-serif'
ctx.fillText(feedback.text, canvas.width / 2, 300)
}
```feedback is null (no message) after reset.if (feedback) is true only when there is a message; then it is written in its color, centred at y = 300.let lit write let feedback.reset, above lit = [0, 0, 0, 0], write feedback = null.draw, under the ['D', 'F', 'J', 'K'] line, write the if (feedback) block.Skills: Game states
← One press, one hit Say Hit →