|
|
@ -20,8 +20,7 @@ function rotate(rouleau, angle){ |
|
|
|
let i = 0; |
|
|
|
let interval = setInterval(() => { |
|
|
|
if (i >= angle){ |
|
|
|
rouleau.style.transform = 'rotate3d(1,0,0,'+angle+'deg)'; |
|
|
|
clearInterval(interval); |
|
|
|
clearInterval(interval); |
|
|
|
} |
|
|
|
else { |
|
|
|
i += 9; |
|
|
@ -41,6 +40,7 @@ function tirette(){ |
|
|
|
document.getElementById('tirette').style.transform = 'rotate3d(1,0,0,'+(360-i)+'deg)'; |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
document.getElementById('tirette').style.transform = 'rotate3d(1,0,0,'+i+'deg)'; |
|
|
|
} |
|
|
|
i += 9; |
|
|
@ -50,9 +50,10 @@ function tirette(){ |
|
|
|
|
|
|
|
function tirage(){ |
|
|
|
let numbers = [nbAlea(), nbAlea(), nbAlea()] |
|
|
|
rotate(document.getElementsByClassName("cube")[0], (Math.floor(Math.random()*15)*360) - (numbers[0]*36)); |
|
|
|
rotate(document.getElementsByClassName("cube")[1], (Math.floor(Math.random()*15)*360) - (numbers[1]*36)); |
|
|
|
rotate(document.getElementsByClassName("cube")[2], (Math.floor(Math.random()*15)*360) - (numbers[2]*36)); |
|
|
|
console.log(numbers); |
|
|
|
rotate(document.getElementsByClassName("cube")[0], Math.floor(Math.random()*(15-1)+1)*360 - numbers[0]*36); |
|
|
|
rotate(document.getElementsByClassName("cube")[1], Math.floor(Math.random()*(15-1)+1)*360 - numbers[1]*36); |
|
|
|
rotate(document.getElementsByClassName("cube")[2], Math.floor(Math.random()*(15-1)+1)*360 - numbers[2]*36); |
|
|
|
return numbers |
|
|
|
} |
|
|
|
|
|
|
@ -88,16 +89,16 @@ function gain(tirage){ |
|
|
|
if(tirage[0] == 9 && |
|
|
|
tirage[1] == 9 && |
|
|
|
tirage[2] == 9){ |
|
|
|
return bac |
|
|
|
return game.bac |
|
|
|
} |
|
|
|
else if(tirage[0] == tirage[1] && |
|
|
|
tirage[1] == tirage[2]){ |
|
|
|
return mise*6 |
|
|
|
return game.mise*6 |
|
|
|
} |
|
|
|
else if(tirage[0] == tirage[1] || |
|
|
|
tirage[0] == tirage[2] || |
|
|
|
tirage[1] == tirage[2]){ |
|
|
|
return mise*3 |
|
|
|
return game.mise*3 |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|