A simple and interactive Rock–Paper–Scissors game built using HTML, CSS, and JavaScript. This project is beginner‑friendly and demonstrates DOM manipulation, event handling, and basic game logic in JavaScript.
- Play Rock, Paper, or Scissors against the computer
- Random computer choice generation
- Real‑time score tracking (User vs Computer)
- Dynamic result messages (Win / Lose / Draw)
- Clean and responsive UI
- Hover effects for better user interaction
- HTML5 – Structure of the game
- CSS3 – Styling and layout
- JavaScript (Vanilla) – Game logic and interactivity
rock-paper-scissors/
│
├── index.html # Main HTML file
├── style.css # Styling
├── app.js # Game logic
├── images/ # Game icons
│ ├── rock.png
│ ├── paper.png
│ └── scissors.png
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/your-username/rock-paper-scissors.git
-
Navigate to the project folder:
cd rock-paper-scissors -
Open
index.htmlin your browser.
✅ No additional setup required.
-
Click on Rock, Paper, or Scissors.
-
The computer randomly selects its move.
-
The game logic compares both choices:
- Same choice → Draw
- Rock beats Scissors
- Paper beats Rock
- Scissors beats Paper
-
Scores are updated instantly.
-
A message displays the result of each round.
genCompChoice()– Generates a random computer moveplayGame(userChoice)– Main game logicshowWinner()– Updates scores and result messagedrawGame()– Handles draw scenarios- Event listeners detect user clicks
-
Circular choice buttons with hover effects
-
Centered layout using Flexbox
-
Dynamic message background color:
- 🟢 Green → Win
- 🔴 Red → Loss
- 🔵 Blue → Draw
- Add sound effects
- Add reset button
- Add animations
- Make mobile‑first responsive
- Multiplayer mode
(Add a screenshot or GIF of your game here)
Contributions are welcome!
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
Your Name GitHub: your-username
⭐ If you like this project, don’t forget to star the repository!