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