-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
177 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Rock Paper Scissors Game with UI | ||
|
||
## Overview | ||
|
||
This project is an interactive Rock Paper Scissors game, created as part of the Foundations Course in [The Odin Project](https://www.theodinproject.com/lessons/foundations-rock-paper-scissors). The primary focus is to implement a user interface (UI) using HTML, CSS, and JavaScript, offering an engaging and dynamic gaming experience. | ||
|
||
## Project Overview | ||
|
||
The Rock Paper Scissors game is designed with a modular JavaScript approach, for efficient code organization. The UI includes buttons for player selections, real-time score tracking, and round results, providing a seamless gaming experience. | ||
|
||
## Features | ||
|
||
- **Interactive UI:** Players make selections by clicking on buttons (Rock, Paper, Scissors). | ||
- **Dynamic Score Tracking:** Player and computer scores are updated in real-time. | ||
- **Round Results:** Immediate display of outcomes for each round. | ||
- **Restart Functionality:** A "Play again" button allows users to restart the game. | ||
- **Responsive Design:** The UI is designed for optimal viewing on various devices. | ||
|
||
## Project Structure | ||
|
||
The project is structured with modular JavaScript, promoting clean and maintainable code. | ||
|
||
## Technologies Used | ||
|
||
- **HTML:** Structure of the webpage. | ||
- **CSS:** Styling for an attractive appearance. | ||
- **JavaScript (ES6):** Core logic for game functionality. | ||
|
||
## How to Play | ||
|
||
1. Click on the buttons (Rock, Paper, or Scissors) to make your selection. | ||
2. The computer will randomly choose its move. | ||
3. Scores are updated dynamically, and round results are displayed. | ||
4. Continue playing until one player reaches 5 points. | ||
5. Click "Play again" to restart the game. | ||
|
||
## Live Demo | ||
|
||
Experience the live demo of the Rock Paper Scissors game with UI by visiting [this link](https://extf8.github.io/RockPaperScissors/). | ||
|
||
Enjoy the interactive and dynamic gameplay! Explore the GitHub repository for the complete code and project history. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Rock Paper Scissors</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<script src="script.js" defer></script> | ||
</head> | ||
<body> | ||
<section id="page-wrapper"> | ||
<h1>Rock Paper Scissors</h1> | ||
<p>First to 5 points wins</p> | ||
<div class="round"> | ||
<h3>Round:</h3> | ||
<p class="round-number">1</p> | ||
</div> | ||
<div id="game-wrapper"> | ||
<div class="player-container"> | ||
<div class="user-container"> | ||
<h2>Human</h2> | ||
<div class="score"> | ||
<h3>Score:</h3> | ||
<p class="user-score">0</p> | ||
</div> | ||
</div> | ||
<div class="user-buttons"> | ||
<button class="rock" data-selection="rock">Rock</button> | ||
<button class="paper" data-selection="paper">Paper</button> | ||
<button class="scissors" data-selection="scissors">Scissors</button> | ||
</div> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Rock Paper Scissors</title> | ||
<link rel="stylesheet" href="style.css" /> | ||
<script src="script.js" defer></script> | ||
</head> | ||
<body> | ||
<section id="page-wrapper"> | ||
<h1>Rock Paper Scissors</h1> | ||
<p>First to 5 points wins</p> | ||
<div class="round"> | ||
<h3>Round:</h3> | ||
<p class="round-number">1</p> | ||
</div> | ||
<div class="player-container"> | ||
<div class="user-container"> | ||
<h2>Computer</h2> | ||
<div class="score"> | ||
<h3>Score:</h3> | ||
<p class="computer-score">0</p> | ||
<div id="game-wrapper"> | ||
<div class="player-container"> | ||
<div class="user-container"> | ||
<h2>Human</h2> | ||
<div class="score"> | ||
<h3>Score:</h3> | ||
<p class="user-score">0</p> | ||
</div> | ||
</div> | ||
<div class="user-buttons"> | ||
<button class="rock" data-selection="rock">Rock</button> | ||
<button class="paper" data-selection="paper"> | ||
Paper | ||
</button> | ||
<button class="scissors" data-selection="scissors"> | ||
Scissors | ||
</button> | ||
</div> | ||
</div> | ||
<div class="user-buttons"> | ||
<button class="computer-rock">Rock</button> | ||
<button class="computer-paper">Paper</button> | ||
<button class="computer-scissors">Scissors</button> | ||
<div class="player-container"> | ||
<div class="user-container"> | ||
<h2>Computer</h2> | ||
<div class="score"> | ||
<h3>Score:</h3> | ||
<p class="computer-score">0</p> | ||
</div> | ||
</div> | ||
<div class="user-buttons"> | ||
<button class="computer-rock">Rock</button> | ||
<button class="computer-paper">Paper</button> | ||
<button class="computer-scissors">Scissors</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="result-content"> | ||
<h2 class="result"></h2> | ||
</div> | ||
</section> | ||
</body> | ||
|
||
</html> | ||
</div> | ||
<div class="result-content"> | ||
<h2 class="result"></h2> | ||
</div> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters