First Dice game; 2048 for mobile partialy; Shadows and custom background in rock paper scissors

This commit is contained in:
2024-08-09 00:05:18 +02:00
parent dc5bc86832
commit 5664a525db
19 changed files with 227 additions and 14 deletions

View File

@@ -0,0 +1,17 @@
const dice = document.querySelector('#dice'); //img
let answear = document.querySelector('#answear'); //text ans
let number = document.querySelector('#num'); //num selec
function roll(){
let newDice = Math.floor(Math.random()*6);
console.log(newDice);
dice.src = `./${newDice+1}.png`;
if(number.value == newDice+1){
answear.innerHTML = `<p class='won'>Correct! +10 coins</p>`;
}else{
answear.innerHTML = `<p class='lose'>Wrong!</p>`
}
}