Skip to content

Commit

Permalink
Russian Roulette
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshitmishra001 committed Jun 10, 2024
1 parent 5ecb57f commit 8051c00
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
25 changes: 25 additions & 0 deletions Games/Russian_Roulette/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Russian Roulette</title>
<link rel="stylesheet" href="style.css">
</head>

<body>
<div class="game-container">
<h1>Russian Roulette</h1>
<div class="target" id="target">🎯</div>
<img id="waterGun" src="assets\images\Gun_Default.png" alt="Water Gun" class="water-gun">
<button id="shootButton">Shoot</button>
<p id="message"></p>
<p id="shotsLeft"></p>
<p id="Deaths"></p>
</div>
<audio id="shotSound" src="assets\sounds\Gunsot Sound.wav"></audio>
<script src="script.js"></script>
</body>

</html>
27 changes: 27 additions & 0 deletions Games/Russian_Roulette/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<h1>Russian Roulette: A Game of Chance 🎲🔫</h1>

<h3></h3>Get ready to test your luck in this thrilling game of Russian Roulette! This simple yet addictive game puts your nerves on edge as you spin the chamber and take your chances.<h3>
<h2>Features:</h2>
<ul>
<li> Realistic Gun: A visually appealing gun model that adds to the tension.</li>
<li>A Single Button to Play: Click the button to spin the chamber and fire!</li>
<li>33% Chance of Death: The odds are against you, with a 1 in 3 chance of the gun firing.</li>
<li>Death Counter: Keep track of your unlucky attempts with a visually displayed death counter.</li>
<li>Thrilling Sound Effects: A realistic gunshot sound plays when you're unlucky.</li>
</ul>
<h2>Gameplay:</h2>
<ul>
<li>Click the button to "spin" the chamber.</li>
<li>The game randomly decides whether or not the gun will fire.</li>
<li>If the gun fires, you "die" and the death counter increases.</li>
<li>Play again and see how long you can survive!</li>
</ul>
<h2>Game Points:</h2>
<ul>
<li>Gun: A visual representation of the weapon.</li>
<li>Button: A clickable button that triggers the chamber spin.</li>
<li>33% Chance: The probability of the gun firing.</li>
<li>Death Counter: Displays the number of times you've been "shot."</li>
</ul>
<h3>Get ready for a game that's both thrilling and terrifying. Download Russian Roulette today and see how long you can survive!</h3>

28 changes: 28 additions & 0 deletions Games/Russian_Roulette/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
document.addEventListener("DOMContentLoaded", () => {
const target = document.getElementById("target");
const shootButton = document.getElementById("shootButton");
const message = document.getElementById("message");
const shotsLeft = document.getElementById("shotsLeft");
const waterGun = document.getElementById("waterGun");
const shotSound = document.getElementById("shotSound");

let shots = 0;
let Death = 0;
shootButton.addEventListener("click", () => {
shots++;
const isShotSuccessful = Math.random() < 0.33;
if (isShotSuccessful) {
message.textContent = "Shot! You Died!";
target.style.color = "blue";
waterGun.src = "assets/images/Gun_Shoot.png";
Death++;
shotSound.play();
} else {
message.textContent = "Safe! You missed.";
target.style.color = "black";
}
shotsLeft.textContent = `Shots taken: ${shots}`;
Deaths.textContent = `Deaths: ${Death}`;
setTimeout(() => { waterGun.src = "assets/images/Gun_Default.png"; }, 3500);
});
});
44 changes: 44 additions & 0 deletions Games/Russian_Roulette/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}

.game-container {
text-align: center;
}

.target {
font-size: 3rem;
margin: 20px;
}

.water-gun {
width: 200px;
height: auto;
margin: 20px;
}

button {
padding: 10px 20px;
font-size: 1rem;
cursor: pointer;
}

#message {
font-size: 1.2rem;
margin-top: 20px;
}

#shotsLeft {
font-size: 1rem;
margin-top: 10px;
}

#Deaths {
font-size: 1rem;
margin-top: 10px;
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ This repository also provides one such platforms where contributers come over an
| [16_Puzzle](https://github.com/kunjgit/GameZone/tree/main/Games/16_Puzzle) |
| [Musical_Memory](https://github.com/kunjgit/GameZone/tree/main/Games/Musical_Memory) |
|[Quick_Click](https://github.com/kunjgit/GameZone/tree/main/Games/Quick_Click) |
|[Russian_Roulette](https://github.com/kunjgit/GameZone/tree/main/Games/Russian_Roulette) |
| [Dragon_Tower](https://github.com/kunjgit/GameZone/tree/main/Games/Dragon_Tower) |
| [Hover_Board_Effect](https://github.com/kunjgit/GameZone/tree/main/Games/Hover_Board_Effect) |
[Mancala_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Mancala_Game) |
Expand Down
Binary file added assets/audio/Gunsot Sound.wav
Binary file not shown.
Binary file added assets/images/Gun_Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/Gun_Shoot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8051c00

Please sign in to comment.