|
|
@ -18,9 +18,13 @@ function jeu(){ |
|
|
|
} |
|
|
|
joueur -= mise |
|
|
|
bac += mise |
|
|
|
|
|
|
|
|
|
|
|
let tirage = [2,1,2]//[nbAlea(), nbAlea(), nbAlea()];
|
|
|
|
tirageDom.innerText = tirage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let gain_retour = gain(tirage) |
|
|
|
console.log(gain_retour) |
|
|
|
bac -= gain_retour |
|
|
@ -34,7 +38,8 @@ function jeu(){ |
|
|
|
} |
|
|
|
|
|
|
|
function nbAlea(){ |
|
|
|
return Math.floor(Math.random()*9); |
|
|
|
let multiples = [36,72,108,144,180,216,252,288,324] |
|
|
|
return multiples[Math.floor(Math.random()*9)]; |
|
|
|
} |
|
|
|
function gain(tirage){ |
|
|
|
if(tirage[0] == 9 && |
|
|
@ -56,3 +61,19 @@ function gain(tirage){ |
|
|
|
function regles(){ |
|
|
|
//afficher règles
|
|
|
|
} |
|
|
|
|
|
|
|
function rotate(rouleau, angle){ |
|
|
|
let i = 1; |
|
|
|
let interval = setInterval(() => { |
|
|
|
if(i >= angle) {clearInterval(interval); rouleau.style.transform = "rotate3d(1, 0, 0, "+angle+"deg)"} |
|
|
|
rouleau.style.transform = "rotate3d(1, 0, 0, "+i+"deg)" |
|
|
|
i += 5 |
|
|
|
}, 1) |
|
|
|
} |
|
|
|
|
|
|
|
function tirage(){ |
|
|
|
rotate(document.getElementsByClassName("cube")[0], 4*360+nbAlea()) |
|
|
|
rotate(document.getElementsByClassName("cube")[1], 4*360+nbAlea()) |
|
|
|
rotate(document.getElementsByClassName("cube")[2], 4*360+nbAlea()) |
|
|
|
} |
|
|
|
tirage() |