Skip to content

Instantly share code, notes, and snippets.

@jrmedina
Last active June 14, 2022 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrmedina/2d1c6b6043d3069a4a6796612cce5833 to your computer and use it in GitHub Desktop.
Save jrmedina/2d1c6b6043d3069a4a6796612cce5833 to your computer and use it in GitHub Desktop.

Rock Paper Scissors (updated 6.13.21)

Timeline Goals:

  • 6/8 HTML skeleton/format: RPS

  • 6/8 CSS (Basics)

  • 6/9 …. 6/10 the latest Classes:

  • A player.js file that contains a Player class. Player methods must include, but are not limited to: constructor - properties should include: name (ex: 'Human'), token (ex: '👩🏻'), wins (ex: 0)

  • A game.js file that contains a Game class.

    • Two Player instances
    • A way to keep track of the data for the game board
    • A way to keep track of the selected game type
    • A way to check the Game’s board data for win conditions
    • A way to detect when a game is a draw (no one has won)
    • A way to reset the Game’s board to begin a new game
  • 6/11 Classic functionality

  • 6/12 Spicy functionality

  • 6/13 Styling/refactor

  • 6/14 EMERGENCY WHATEVER STUFF

REQUIREMENTS:

  • A timeout is used after a completed game to reset the board.
  • Overall layout should be the same. You can get as creative as you would like with your Rock Paper Scissors design!
  • This game is played by one user against a computer. The computer player should be an instantiation of Player and have the ability to make a random choice.
  • Need to make two versions of Rock, Paper, Scissors - “classic” and some variation. The variation should include more than 3 options (the one in the video has 5). You can invent your own variation, or do some research on variations here. Make sure you communicate the rules to your user!

Suggested:

**

  • Plan out the HTML layout (colors and icons do not need to match, but overall layout should closely match the demo video)
  • Create the Player class
  • Create the Game class
  • Make game fully playable without the DOM (manually updating the Game data, etc, from your console) to force yourself to think data-model-first
  • Create central game board on the DOM
  • Connect Game data model to the DOM
  • Display the Player data in the sidebars
  • Automatically reset the game board to allow for a new game to be played after the previous game is won
  • Extension - Persist Player data using local storage (number of wins should persist across page refreshes)**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment