Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnftitor/rock-paper-scissors
Another Odin Project meant to learn Javascript. All comments are well received as part of the learning process, Thanks!
https://github.com/johnftitor/rock-paper-scissors
Last synced: about 4 hours ago
JSON representation
Another Odin Project meant to learn Javascript. All comments are well received as part of the learning process, Thanks!
- Host: GitHub
- URL: https://github.com/johnftitor/rock-paper-scissors
- Owner: JohnFTitor
- Created: 2021-07-14T23:03:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-21T22:39:46.000Z (over 3 years ago)
- Last Synced: 2024-11-05T23:43:34.708Z (about 2 months ago)
- Language: JavaScript
- Size: 2.35 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
14/07/2021: Starting the project. Setting up the basics. All the logic of the game was set, creating one function for the computerSelection, one for the round, one to check whether the player entry is indeed rock, paper or scissors and one for the game, which plays 5 rounds and declares a winner.
15/07/2021: Created two basic structures:
Home: First page the user sees, with a start button to begin the game. I started to get into some javascript funcionality to manipulate the page with the script, in this case disappear the hole container of the home page. In the next change, I will make it change to gameMode.
GameMode: Contains all the buttons to select rock, paper or scissors, also shows the computer selection, round, score and a message that indicates the state of the round (who won, etc). It is just the structure for now, the next step is to manipulate the logic again to adapt it to the new scenario.
That's all for today.
19/07/2021: Changed the script logic to work with buttons. I almost didn't get it to work, as addEventListener doesn't work within loops, which makes sense has they are created, not called. Solution was quite simple, I only needed to change the entire logic structure, making the eventListener to call the playround function, and checking if the rounds have finished. Finally, I changed the alerts for the textboxes and the text in the buttons for icons, also the computer selections are shown in the enemy's box.
21/07/2021: Rearranged the elements in the viewport and added sounds to the game, also included an html tag for mobile response, although some media queries are still needed to include them all.