|
@ -18,9 +18,13 @@ function jeu(){ |
|
|
} |
|
|
} |
|
|
joueur -= mise |
|
|
joueur -= mise |
|
|
bac += mise |
|
|
bac += mise |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let tirage = [2,1,2]//[nbAlea(), nbAlea(), nbAlea()];
|
|
|
let tirage = [2,1,2]//[nbAlea(), nbAlea(), nbAlea()];
|
|
|
tirageDom.innerText = tirage |
|
|
tirageDom.innerText = tirage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let gain_retour = gain(tirage) |
|
|
let gain_retour = gain(tirage) |
|
|
console.log(gain_retour) |
|
|
console.log(gain_retour) |
|
|
bac -= gain_retour |
|
|
bac -= gain_retour |
|
@ -34,7 +38,8 @@ function jeu(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function nbAlea(){ |
|
|
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){ |
|
|
function gain(tirage){ |
|
|
if(tirage[0] == 9 && |
|
|
if(tirage[0] == 9 && |
|
@ -55,4 +60,20 @@ function gain(tirage){ |
|
|
} |
|
|
} |
|
|
function regles(){ |
|
|
function regles(){ |
|
|
//afficher règles
|
|
|
//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() |