Skip to content

Created original game with use of event listeners and DOM manipulation

Notifications You must be signed in to change notification settings

juleberry/TreasureHunt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Treasure Hunt

Players: human vs computer

Object of game: Players work to reveal as many treasures as they can from the treasure map.

Gameplay:

  1. Click start and enter your name in the input field.
  2. An array of random "spaces" (the treasure map) is chosen and 7 random spaces are converted to "treasures" (strings) in the background. The game randomizes who gets to "pick" a spot to "dig" first.
  3. If computer is chosen to "pick", the game randomizes a choice between 1 and 5 to be the computer's choice. Then, allows the human player to "pick" a spot by inputting a number from 1 to 5 in a pop-up window.
  4. If human player is chosen to "pick" first, the human player inputs a number from 1 to 5 in a pop-up window.
  5. The choices are then revealed on-screen.
  6. Then, the human choice and computer choice is then compared to determine who chose the largest number, which then determines who gets to actually "dig" or claim the space. IF there is a tie, no one gets to claim the space, but it is still revealed.
  7. The space is then "revealed" to determine if the space contained a "rock" or a "treasure".
  8. Whoever is allowed to claim the space, then adds the the "treasure" to their treasure bag.
  9. Gameplay repeats allowing computer and human to "pick" and "reveal" spaces until they have worked through the entire treasure map.
  10. Once the entire treasure map has been "searched" then the winner is determined and celebrated to end the game.

Future Ideas and Features:

  • Add a treasure "bag" where the scores will be kept.
  • Add sound effects.

About

Created original game with use of event listeners and DOM manipulation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published