A simple, straightforward Rock, Paper, Scissors game against the computer.
This is the first JavaScript app I developed, in September 2019, when I'd had enough with core JavaScript kata exercises and started working on closer to real projects, DOM manipulation and event handling. The mechanics of both the game and the code is simple: the user chooses her play, which triggers a randomly generated computer play; the script then compares both plays and displays the result. The user can click anywhere on the page to clear the game and play again.
In October 2020 I made a major refactoring of the code. The main changes were:
- Preload all images to smooth the transition between them.
- Adopted a more object-oriented approach.
- Game result is calculated arithmetically (and not through case by case comparison).
- Improved the layout with CSS transitions displaying the game result.
- Added a counter to keep track of game results.
- HTML
- CSS
- JavaScript (ES6)
under development I intend to add a multiplayer version.
This is the link to the deployed version: https://darioscattolini.github.io/rockpaperscissors
I found the idea for this project in The Odin Project's wonderful curriculum. Here's a link to the assignment: https://www.theodinproject.com/courses/web-development-101/lessons/rock-paper-scissors
Created by Darío Scattolini. Feel free to contact me!