Skip to content

Igorttdp/CupheadDiceGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

🇺🇸 Cuphead Dice Game

Cuphead and Mugman got into trouble with the devil and now he wants the souls of these troublemakers. In another of their adventures, the brothers Cuphead and Mugman suddenly entered a casino. There, they found King Dice who was the venue's manager. King Dice then invited them to a roll of the dice, following the modes: Normal, BO3 or BO5. Cuphead compulsively agreed to enter the dispute with his brother without first verifying the terms and rules. What Cuphead didn't know was that King Dice is the Devil's right hand man and that game was an ambush to capture the soul the Devil didn't receive. What will be the end of the liquid carrier brothers?

About

The project initially proposed was a simple game of dice. I decided to do it my way. To randomize the dices I used Math.random() with the logic necessary to generate numbers between 1 and 6. Through the DOM, the dice numbers are associated with the "src" attribute of the image and changed when the "Roll the dice" button is clicked. To check the winner, a function with an if statement is called to determine which dice has the highest value. In the case of the best 3 or 5 game mode, a score table is started to count the scores of player 1 and 2. The player with the highest score wins.

Preview

Preview

A small preview to show some features.