778569 / The-Dicee-Game-html-css-and-js

An interactive Dicee Game built with HTML, CSS, and JavaScript. Roll the dice and see the results! Check out the code on GitHub for a fun web-based gaming experience.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The-Dicee-Game-html-css-and-js

An interactive Dicee Game built with HTML, CSS, and JavaScript. Roll the dice and see the results! Check out the code on GitHub for a fun web-based gaming experience.

Steps

  • An interactive Dicee Game built with HTML, CSS, and JavaScript. Roll the dice and see the results! Check out the code on GitHub for a fun web-based gaming experience.
  • In the Dicee project, there is a folder called images, add the images of dice6.png as the source to both of the elements.
  • Inside index.js, create a new variable called randomNumber1 then set the value of this variable to a random number between 1 and 6. Test it out in the console to make sure it works as expected.
  • Use the random number you created in the last step to pick out a random dice image between dice1.png to dice 6.png then place this image inside the left element.
  • Change the text in the h1, (which currently says Refresh Me) to show which user won or if there was a draw depending on the dice values of player 1 (left) and player 2 (right).

image

About

An interactive Dicee Game built with HTML, CSS, and JavaScript. Roll the dice and see the results! Check out the code on GitHub for a fun web-based gaming experience.


Languages

Language:JavaScript 40.5%Language:HTML 34.7%Language:CSS 24.9%