Workshop › Rhythm Lanes › Step 24 of 35

Score

What we are doing

A perfect is worth 300 points and a good 100. The score is shown at the top left.

```js
let score

  score = 0

    judged.perfect += 1
    score += 300

    judged.good += 1
    score += 100

  ctx.fillStyle = 'white'
  ctx.font = 'bold 16px sans-serif'
  ctx.textAlign = 'left'
  ctx.fillText('Score ' + score, 12, 24)
```

What it means

Your turn

  1. Under let frame write let score; in reset, under frame = 0, write score = 0.
  2. In press, write the two score += ... lines under the judged lines.
  3. In draw, under the if (feedback) block, write the four score lines.

Skills: Game states

All steps

  1. A stage for the notes
  2. The first lane
  3. Four lanes with a loop
  4. The hit line
  5. A function that draws
  6. The song as text
  7. From text to notes
  8. The clock decides where
  9. Draw the notes
  10. A clock that ticks
  11. The game loop
  12. Lanes that light up
  13. Keys for the lanes
  14. Show the keys
  15. Hit the closest note
  16. Close enough in time
  17. One press, one hit
  18. A message on the screen
  19. Say Hit
  20. Let the message go
  21. Perfect or good
  22. Keep count
  23. Missed notes
  24. Score
  25. Hits in a row
  26. The multiplier
  27. The song ends
  28. Stop the clock
  29. Accuracy
  30. The grade
  31. The results
  32. Play again
  33. Best score
  34. Lanes you can tap
  35. Build it yourself: a speed setting