Skip to content

Axelvazslima/RollTheDiceGame

Repository files navigation

Dice Game Project

This project is a JavaScript game developed during a course by me and the teacher Jonas Schmedtmann. The game is a fast-paced, thrilling competition between two players, where players take turns rolling the dice, and the number of rolls they can make is determined by luck.

Game Rules

In this game, players roll a dice on their turn, with the number on the dice indicating how many points they have earned. Players can roll the dice as many times as they wish until they choose to "hold" or until they roll a 1. If a player rolls a 1, they lose all the points they have accumulated, and it becomes their opponent's turn. However, if they choose to "hold," their points are saved, and their turn ends. The game continues until one player reaches a score of 100, making it an intense race to the finish.

Gameplay

To start playing the game, players can simply click on the "Start Game" button. The game will display a modal where players can enter their names. Once the players have entered their names, they can click on the "Start" button to begin the game. Players can then click on the "Roll Dice" button to roll the dice. After each roll, the player's score is updated, and they have the option to roll again or hold their points. If the player rolls a 1, their turn ends immediately, and their accumulated points are lost. On the other hand, if the player chooses to hold, their points are saved, and their turn ends. The game continues with the second player, and the process repeats until one of the players reaches a score of 100 or more, thus winning the game.

Features

In addition to the gameplay described above, the game also includes the following features:

Open Modal: Players can click on the "Menu" button to open a modal where they can see the game rules and an "About Me" section. Key Event: Click on "ESC" to close the modals.

Technologies Used

This game was developed using the following technologies:

HTML5 CSS3 JavaScript

Project Structure

This project is organized into different folders and files, as follows:

index.html: This file contains the HTML structure of the game's webpage. style.css: This file contains the CSS styles used to design the webpage. script.js: This file contains the JavaScript code that implements the game's logic and functionality.

Project Setup

To set up the project and start playing the game, follow the steps below:

Clone the project repository to your local machine by running the following command in your terminal: bash Copy code git clone https://github.com//dice-game.git Open the project folder in your code editor of choice. Open the index.html file in your web browser to start playing the game.

Credits

This project was developed during a course by me and the teacher Jonas Schmedtmann. Special thanks to Jonas Schmedtmann for the knowledge and resources he provided for this project.