3. Rock Paper Scissors
Table of contents
Lab Goals
- Build our first game using HTML, CSS, and JavaScript.
- Demonstrate ability to use Bootstrap to setup the page layout.
- Demonstrate ability to create forms with the form/input elements.
- Demonstrate understanding of event-oriented programming.
Guidelines
- commit your code frequently.
- Use useful commit messages.
- Make sure tests pass.
- at the end of each of the following steps, run the tests to make sure you finished the step correctly.
- Don’t forget to fill out the self assessment on the README file.
Game Flow
This assignment, we will be building the Rock, Paper, Scissors(RPS) game. We will be utilizing the concepts and techniques covered in the past few weeks to allow a user to play against the Computer. The game flow should be:
- Web page loads with a form to input user’s name (input is required, they cannot submit it without a value).
- concepts: Building forms, Event-handeling, user input validation.
- User submits name and a new form appears with an input for Rock, Paper, or Scissors.
- You can use:
- select/dropdown
- OR buttons
- text buttons (but why would you do that!)
- You can use:
- User submits the form with their selection (input is required, they cannot submit it without a selection)
- Computer Generates a response.
- Determine the winner.
- Display the winner.
- Keep history of selections and winner of each round and display it.
- Reset the form after each round
- User should be able to start a new game.
Instructions
- run
npm install
- Setting up the Layout
- Styling using CSS and Bootstrap 4
- Implementing Game Logic
- Putting it all together
- Finalize and Submit
Extra Credit Opportunity
Unit tests (3 points per test)
- building some unit tests for the Putting it all together portion of the assignment.
Reset Game Button (3 points)
User can Reset the game and Type in a new player name (3 points)
UI Design
Make the game aesthetically pleasing while satisfying the UI tests
- (just adding Rock Paper Scissor images doesn’t count ☺)
Use Buttons instead of Dropdown (1 Extra Credit Points)
Output
Table of contents
- a. Setting up the layout
- b. Styling using CSS and Bootstrap 4
- c. Implementing Game Logic
- d. Putting it all together
- e. Finalize