génération après cliquer

master
adplantade 5 years ago
parent 1bd87b6ea9
commit f65b8f5f29

@ -26,6 +26,7 @@ tabObjCmp=[];
mousePos=[];
var pause=getCookie("pause");
var won=false;
var displayType = getCookie("displayMode")=="" ? "gems" : getCookie("displayMode");
@ -551,7 +552,7 @@ function checkAllOK(justChecking=false){
if(pause)
chronoStop();
handleScore(1);
generate();
won=true;
}
else if(justChecking)
{
@ -578,22 +579,19 @@ function handleScore(modif)
{
points+=modif;
document.getElementById("stats").innerHTML = points+" points";
for(var cpt=1;cpt<5;cpt++)
{
document.getElementById("canvas"+cpt).classList.add("win");
}
setTimeout(function()
{
document.getElementById("canvasObj").classList.add("win");
document.getElementById("canvasTotal").classList.add("win");
for(var cpt=1;cpt<5;cpt++)
{
document.getElementById("canvas"+cpt).classList.remove("win");
document.getElementById("canvas"+cpt).classList.add("win");
}
}, 1000);
if(objPts!=null && points==objPts)
{
chronoStop();
var pts = diff.getSeconds()+ (diff.getMinutes()*60) + ((diff.getHours()-1)*3600);
window.location.replace("./score.php?pts="+pts+"&mode="+get['mode']+"&diff="+get['diff']+"&pseudo="+get['pseudo']);
}
@ -682,6 +680,21 @@ function events() {
function mdManager(e){
mousePos = [e.currentTarget.id.substring(6),compas(e.clientX,e.clientY,e.currentTarget)];
document.getElementById("canvasObj").classList.remove("win");
document.getElementById("canvasTotal").classList.remove("win");
for(var cpt=1;cpt<5;cpt++)
{
document.getElementById("canvas"+cpt).classList.remove("win");
}
if(won)
{
won=!won;
generate();
}
if(paused)
chronoContinue();
document.getElementById(e.currentTarget.id).classList.add('vitrail-select');

Loading…
Cancel
Save