Rock, Paper, Scissors, Lizard, Spock is a game of chance that expands the traditional game of Rock, Paper, Scissors. The game was originally created by Sam Kass with Karen Bryla. Users can have fun with this extended traditional game playing against computer and learning new rules for the game.
- Header
- At the top of the page is name of the game which inicates to user what game they are playing.
- Game options
- Game options include 5 interactive buttons that the user can click and make their choice.
- Game Results
- After user clicks their option, image will change depending of their option.
- JavaScript code chooses a random option for the computer and also change computer picture depending of the option.
- JavaScript code determines the winner and displays it below the images.
- The score is updated for the player and the computer after every game.
- First one to reach 5 points wins the game.
- The Footer
- The footer section explains rules for the game so the user can understand how the game is played.
- HTML
- No errors were returned when passing through the official W3C validator.
- CSS
- No errors were found when passing through the official (Jigsaw) validator.
-
JavaScript validator
- No errors were foubd when passing through the JSHint JavaScript validator.
-
Lighthouse testing
- For desktop testing results are as follows:
- For mobile testing results are as follows:
- WAVE testing
- Also I did a WAVE testing
- When creating a game I encounter a problem with result. My code for result was
let result = checkWinner(playerChoice, computerChoice);
- Fixed the problem with a code
let result = checkWinner(choices[playerChoice], choices[computerChoice]);
- Later in development in game I could not get a tie so I added console.log for player, computer and result to see what I did wrong. I fixed that part adding
computerChoiceIndex
forcomputerChoice
and fixed the problem.
- There were no usolved bugs
- The site was deployed to GitHub pages. The steps to deploy are as follows:
- In the GitHub repository, navigate to the Settings tab
- From the source section drop-down menu, select the Pages
- In Build and deployment select source Deploy from a branch
- Choose branch main and save
- On top the Pages you will find the link to indicate the successful deployment
The live link can be found here - https://zvonimir667.github.io/milestone2/
- The structure for the code and the game was inspired by Love Maths project particularly HTML and CSS, and JavaScript was written mostly by trial and error until satisfactory result.
- Fonts used are from Google Fonts.
- The images for this project are taken from the puzzlewocky site