johneastman / circles

A point-and-click browser game
https://johneastman.github.io/circles/
MIT License
0 stars 0 forks source link

Display score based on game mode #53

Closed johneastman closed 1 year ago

johneastman commented 1 year ago

For both game modes, the high score is stored as a number, so we need to be able to determine whether that number represents time or number data.

Initial Implementation Plan

  1. Add a method to HighScore called getScore that returns the score as a string based on the data type flag (number or time).
  2. Create a Score component that accepts as one of the props a HighScore object and calls getScore to display the score.
  3. Rename HighScore to Score.
  4. Use this Component for displaying both the running score and high scores.

Places the score need to be updated

johneastman commented 1 year ago

The implementation panned out differently than planned, but all the requirements have been implemented.

Commit: https://github.com/johneastman/circles/commit/0ce2b51904d97320b2ba18b3f0ec6ee36f41c622