A modern and interactive implementation of the classic Rock-Paper-Scissors game. Play against the computer, view real-time results, and enjoy a seamless experience with persistent score tracking and a clean user interface.
This project demonstrates a well-structured and feature-rich web-based game, designed to showcase:
- Interactive gameplay mechanics.
- Dynamic updates with JavaScript.
- Persistent data storage using
localStorage
.
Deployed version: Rock-Paper-Scissors Game
- User Interaction:
- Players choose from Rock, Paper, or Scissors via interactive icons.
- Real-Time Score Updates:
- Tracks scores for both the user and the computer.
- Outcome Display:
- Highlights win, loss, or draw with custom messages and dynamic colors.
- Score Persistence:
- Scores are saved locally, ensuring continuity even after refreshing the page.
- Reset Functionality:
- A "Clear History" button allows players to reset their scores for a fresh start.
- HTML: Provides the structure for the game interface.
- CSS: Enhances the game with a visually appealing design.
- JavaScript: Powers the game logic, interactivity, and local storage management.
-
Game Logic:
- Users select a choice: Rock, Paper, or Scissors.
- The computer makes a random choice.
- The winner is determined based on standard game rules:
- Rock beats Scissors.
- Paper beats Rock.
- Scissors beat Paper.
- A dynamic message displays the result along with the choices made.
-
Score Management:
- Scores for both the user and the computer are updated in real-time.
- Scores are stored in
localStorage
to ensure persistence.
-
Reset Functionality:
- The "Clear History" button clears stored scores and resets the game.
follow these steps to run the Rock Paper Scissors locally:
-
Clone the repository:
git clone https://github.com/shivlalsharma/rock-paper-scissors.git cd rock-paper-scissors
-
Open the
index.html
file in your browser.Alternatively, you can set up a local server (e.g., using VS Code Live Server) to view the game in your browser.
This project is licensed under the MIT License. See the LICENSE file for details.
Created and deployed by Shivlal Sharma.
- GitHub: Shivlal Sharma's GitHub
- LinkedIn: Shivlal Sharma's LinkedIn