Crystal Collector

Description

Here is how the app works:

  • When the game starts, values will be randomly generated for all of the four crstals--which are hidden from the user--as well as the target score that is displayed on screen.

  • Since the values for the crystals are hidden, it is the players responsibility to determine their individual values, and they can do so by clicking one. When a crystal is clicked, it's value will be added to the player's total score.

  • The player will win if their total score matches the random number that was generated at the beginning of the game. Likewise, the player will lose if their score exceeds the random number.

  • The game will restart if the player wins or loses.

  • When the game restarts, new values will be generated, again, for both the group of crystals and the target score. The win-count and loss-count will also be reset to zero.

Live Demo:

https://aces15224.github.io/unit-4-game/