Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Game] Roll_The_Dice game added #4076

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Games/Roll_The_Dice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
**Roll the Dice**

---

<br>

## **Description 📃**

<!-- add your game description here -->

-Roll the Dice is a simple and fun game where the objective is to roll a pair of dice and try to achieve a specific score or beat your previous best. It's a game of chance that tests your luck and provides an exciting challenge each time you play.

## **functionalities 🎮**

<!-- add functionalities over here -->

- Clean and intuitive user interface
- Realistic dice rolling animation
- Option to roll one or two dice
- Score tracking to keep track of your progress
- Ability to reset the game and start a new session
<br>

## **How to play? 🕹️**

<!-- add the steps how to play games -->

- The game presents you with a button to roll the dice.
- Your goal is to roll the dice and try to achieve the highest possible score.
- Click or tap on the "Roll" button to roll the dice.
- The dice will roll and display a random number between 1 and 6 for each die.
- The sum of the numbers on the dice will be your score for that roll.
- The game keeps track of your total score and the number of rolls.
- If you wish to roll again, simply click or tap on the "Roll" button again.
- You can continue rolling the dice as many times as you like.
- The game can be reset at any time by clicking or tapping on the "Reset" button.
- Enjoy the thrill of the roll and aim for the highest score possible!

<br>

## **ScreenShots**

![Dice_Number](./images/dice1.png)
![Dice_Number](./images/dice2.png)
![Dice_Number](./images/dice3.png)
![Dice_Number](./images/dice4.png)
![Dice_Number](./images/dice5.png)
![Dice_Number](./images/dice6.png)
<br>
31 changes: 31 additions & 0 deletions Games/Roll_The_Dice/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Dicee</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Indie+Flower|Lobster" rel="stylesheet">

</head>
<body>
<div class="container">
<h1>Refresh Me</h1>

<div class="dice">
<p>Player 1</p>
<img class="img1" src="">
</div>

<div class="dice">
<p>Player 2</p>
<img class="img2" src="">
</div>

</div>
<script src="index.js"></script>

</body>

<footer>
</footer>
</html>
19 changes: 19 additions & 0 deletions Games/Roll_The_Dice/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var randomNumber1 = Math.floor(Math.random() * 6 + 1);
var randomImage = "Dice" + randomNumber1 + ".png";
var randomImageSource1 = "images/" + randomImage;
var image1 = document.querySelectorAll("img")[0];
image1.setAttribute("src", randomImageSource1);

var randomNumber2 = Math.floor(Math.random() * 6 + 1);
var randomImageSource2 = "images/Dice" + randomNumber2 + ".png";
// var randomImageSource2 = "images/" + randomImage;

document.querySelectorAll("img")[1].setAttribute("src",randomImageSource2);

if(randomNumber1 > randomNumber2){
document.querySelector("h1").innerHTML = "Player 1 Won!!!";
// alert("player 1 won");
}
else if(randomNumber2>randomNumber1){
document.querySelector("h1").innerHTML= "player 2 Won!!!"
}
33 changes: 33 additions & 0 deletions Games/Roll_The_Dice/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
body {
background-color: #464239;
}
.container {
width: 70%;
margin: auto;
text-align: center;
}

.dice {
text-align: center;
display: inline-block;
}


h1 {
margin: 30px;
font-family: 'Lobster', cursive;
text-shadow: 5px 0 #baeaa2;
font-size: 8rem;
color: #4ECCA3;
}

p {
font-size: 4rem;
color: #4ECCA3;
/* font-family: 'Indie Flower', cursive; */
}

img {
width: 80%;
}

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,11 @@ This repository also provides one such platforms where contributers come over an
| [Guess_The_Song](https://github.com/kunjgit/GameZone/tree/main/Games/Guess_The_Song) |
| [NewsJunction](https://github.com/kunjgit/GameZone/tree/main/Games/NewsJunction) |
| [Recognizing_Figures](https://github.com/kunjgit/GameZone/tree/main/Games/Recognizing_Figures) |
[Roll_The_Dice](https://github.com/kunjgit/GameZone/tree/main/Games/Roll_The_Dice) |
| [Black_jackk](https://github.com/kunjgit/GameZone/tree/main/Games/Black_jackk) |

| [Recognizing_Figures](https://github.com/kunjgit/GameZone/tree/main/Games/Recognizing_Figures) | [Screen Pet Game](https://github.com/kunjgit/GameZone/tree/main/Games/Screen-Pet-Game) |

| [Sudoku_light_theme](https://github.com/kunjgit/GameZone/tree/main/Games/Sudoku_light_theme) |
| [Find_the_ball](https://github.com/kunjgit/GameZone/tree/main/Games/Find_the_ball) |
|[Color The Page](https://github.com/kunjgit/GameZone/tree/main/Games/Color_The_Page)|
Expand Down
Binary file added assets/images/Roll_The_Dice.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/Roll_The_Dice.webp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading