https://ilene0413.github.io/unit-4-game/
Crystal collector
A player is given a random number to match. The random number is determined using Math.Random. Maximum random number is 120.
Each crystal is given a unique random number. Random number is determined using Math.Random. The masximum number is 12.
The object of the game is to match the random number by clicking on the crystals.
Players click on the crystals to add to their score.
When the player's score matches the random number, the player wins and a new game is generated.
When the game starts, the startGame function is called which will determine the random number to match and the random number on the crystals. It will also initalize the players score and create the crystal buttons.
The player will click on a crystal.
Determine which crystal was clicked and it's value.
The value of the crystal is added to the player's score.
The players score is then checked against the random number to match.
If the numbers, match the player wins and the win total is incremented.
If the players score is less than the random number, the player clicks another crystal.
If the players score is greater than the random number, the round is over and the player loses. The losses counter is updated.
A new game will be started after 1 second.
Pictures were taken from images doing google search and come from many different websites.
Developed by Ilene Cohen.
email: ilene413@icloud.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Ilene0413/unit-4-game
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published