|
|
@ -8,7 +8,6 @@ function tryChangePseudo() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setPseudoOk(newPseudo, change) {
|
|
|
|
function setPseudoOk(newPseudo, change) {
|
|
|
|
document.querySelector("#saveIco").className = "fa fa-save";
|
|
|
|
|
|
|
|
document.querySelector("#saveIco").style.color = "green";
|
|
|
|
document.querySelector("#saveIco").style.color = "green";
|
|
|
|
if (change) {
|
|
|
|
if (change) {
|
|
|
|
changePseudo(newPseudo, pseudo);
|
|
|
|
changePseudo(newPseudo, pseudo);
|
|
|
@ -18,12 +17,10 @@ function setPseudoOk(newPseudo, change) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function setPseudoNotOk() {
|
|
|
|
function setPseudoNotOk() {
|
|
|
|
document.querySelector("#saveIco").className = "fa fa-save";
|
|
|
|
|
|
|
|
document.querySelector("#saveIco").style.color = "#fe8a71";
|
|
|
|
document.querySelector("#saveIco").style.color = "#fe8a71";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector("#pseudoInput").addEventListener('input', (event) => {
|
|
|
|
document.querySelector("#pseudoInput").addEventListener('input', (event) => {
|
|
|
|
document.querySelector("#saveIco").className = "fa fa-database dys";
|
|
|
|
|
|
|
|
isPseudoOk(document.querySelector("#pseudoInput").value, false);
|
|
|
|
isPseudoOk(document.querySelector("#pseudoInput").value, false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -666,6 +663,7 @@ function checkEnd(mode) {
|
|
|
|
function success(mode) {
|
|
|
|
function success(mode) {
|
|
|
|
document.querySelector("#play_menu_game").style.display = "none";
|
|
|
|
document.querySelector("#play_menu_game").style.display = "none";
|
|
|
|
modeG = mode;
|
|
|
|
modeG = mode;
|
|
|
|
|
|
|
|
time = timer.getTimeValues().seconds;
|
|
|
|
timeTot = timeTot + timer.getTimeValues().seconds;
|
|
|
|
timeTot = timeTot + timer.getTimeValues().seconds;
|
|
|
|
timer.stop();
|
|
|
|
timer.stop();
|
|
|
|
stage.findOne("#end").fill(colorSwitchActiveBackground);
|
|
|
|
stage.findOne("#end").fill(colorSwitchActiveBackground);
|
|
|
@ -681,10 +679,8 @@ function success(mode) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (successPanel) {
|
|
|
|
if (successPanel) {
|
|
|
|
if (isFinish) {
|
|
|
|
if (isFinish) {
|
|
|
|
showDiv(document.querySelector("#mainPage"));
|
|
|
|
document.querySelector("#lose_pannel").style.display = "block";
|
|
|
|
hideDiv(document.querySelector("#playPage"));
|
|
|
|
document.querySelector("#play_menu_game").style.display = "none";
|
|
|
|
|
|
|
|
|
|
|
|
openModal("gameOver");
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
switch (mode) {
|
|
|
|
case "vanillaFacile":
|
|
|
|
case "vanillaFacile":
|
|
|
|
document.querySelector("#gameOverTitle").innerHTML = 'Vanilla Facile';
|
|
|
|
document.querySelector("#gameOverTitle").innerHTML = 'Vanilla Facile';
|
|
|
@ -698,16 +694,17 @@ function success(mode) {
|
|
|
|
if (niveauActuel === 1)
|
|
|
|
if (niveauActuel === 1)
|
|
|
|
scoreTot = 0;
|
|
|
|
scoreTot = 0;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
scoreTot = ((1 / timeTot) * (1 / clickTot) * 1000).toFixed(2);
|
|
|
|
scoreTot = ((1 / timeTot) * (1 / clickTot) * 100000).toFixed(2);
|
|
|
|
document.querySelector("#scoreTotGameOver").innerHTML = "Score : " + scoreTot;
|
|
|
|
document.querySelector("#scoreTotGameOver").innerHTML = "Score : " + scoreTot;
|
|
|
|
document.querySelector("#niveauGameOver").innerHTML = niveauActuel;
|
|
|
|
document.querySelector("#niveauGameOver").innerHTML = niveauActuel;
|
|
|
|
document.querySelector("#TempsTotGameOver").innerHTML = "Temps : " + timeTot;
|
|
|
|
document.querySelector("#TempsTotGameOver").innerHTML = "Temps : " + timeTot + " s";
|
|
|
|
sendScore(scoreTot, mode, clickTot, niveauActuel, 25, timeTot);
|
|
|
|
sendScore(scoreTot, mode, clickTot, niveauActuel, 25, timeTot);
|
|
|
|
clickTot = 0;
|
|
|
|
clickTot = 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
document.querySelector("#win_pannel").style.display = "block";
|
|
|
|
document.querySelector("#win_pannel").style.display = "block";
|
|
|
|
//openModal("success");
|
|
|
|
//openModal("success");
|
|
|
|
document.querySelector("#click_number").innerHTML = click;
|
|
|
|
document.querySelector("#click_number").innerHTML = click;
|
|
|
|
|
|
|
|
document.querySelector("#time_number").innerHTML = time;
|
|
|
|
document.querySelector("#next_level_button").onclick = function () {
|
|
|
|
document.querySelector("#next_level_button").onclick = function () {
|
|
|
|
//closeModal('success');
|
|
|
|
//closeModal('success');
|
|
|
|
nextLevel(mode);
|
|
|
|
nextLevel(mode);
|
|
|
@ -750,6 +747,49 @@ function nextLevel(mode) {
|
|
|
|
launchMoyenGameOne(mode);
|
|
|
|
launchMoyenGameOne(mode);
|
|
|
|
} else if (mode === "vanillaImpossible" || mode === "normalImpossible") {
|
|
|
|
} else if (mode === "vanillaImpossible" || mode === "normalImpossible") {
|
|
|
|
launchImpossibleGameOne(mode);
|
|
|
|
launchImpossibleGameOne(mode);
|
|
|
|
|
|
|
|
} else if (mode === "vanillaFacile1" || mode === "normalFacile1") {
|
|
|
|
|
|
|
|
launchFacileChapitre1(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaFacile2" || mode === "normalFacile2") {
|
|
|
|
|
|
|
|
launchFacileChapitre2(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaFacile3" || mode === "normalFacile3") {
|
|
|
|
|
|
|
|
launchFacileChapitre3(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaFacile4" || mode === "normalFacile4") {
|
|
|
|
|
|
|
|
launchFacileChapitre4(mode);
|
|
|
|
|
|
|
|
} else if (mode === "vanillaFacile5" || mode === "normalFacile5") {
|
|
|
|
|
|
|
|
launchFacileChapitre5(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//Moyen
|
|
|
|
|
|
|
|
else if (mode === "vanillaMoyen1" || mode === "normalMoyen1") {
|
|
|
|
|
|
|
|
launchMoyenChapitre1(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaMoyen2" || mode === "normalMoyen2") {
|
|
|
|
|
|
|
|
launchMoyenChapitre2(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaMoyen3" || mode === "normalMoyen3") {
|
|
|
|
|
|
|
|
launchMoyenChapitre3(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaMoyen4" || mode === "normalMoyen4") {
|
|
|
|
|
|
|
|
launchMoyenChapitre4(mode);
|
|
|
|
|
|
|
|
} else if (mode === "vanillaMoyen5" || mode === "normalMoyen5") {
|
|
|
|
|
|
|
|
launchMoyenChapitre5(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//Impossible :
|
|
|
|
|
|
|
|
else if (mode === "vanillaImpossible1" || mode === "normalImpossible1") {
|
|
|
|
|
|
|
|
launchImpossibleChapitre1(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaImpossible2" || mode === "normalImpossible2") {
|
|
|
|
|
|
|
|
launchImpossibleChapitre2(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaImpossible3" || mode === "normalImpossible3") {
|
|
|
|
|
|
|
|
launchImpossibleChapitre3(mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (mode === "vanillaImpossible4" || mode === "normalImpossible4") {
|
|
|
|
|
|
|
|
launchImpossibleChapitre4(mode);
|
|
|
|
|
|
|
|
} else if (mode === "vanillaImpossible5" || mode === "normalImpossible5") {
|
|
|
|
|
|
|
|
launchImpossibleChapitre5(mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -917,7 +957,6 @@ function goToSelection(btn) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function vanillaSelection() {
|
|
|
|
function vanillaSelection() {
|
|
|
|
document.querySelector("#title_selection_2").innerHTML = "Vanilla";
|
|
|
|
|
|
|
|
document.querySelector("#selectionNormalContainer").style.display = "none";
|
|
|
|
document.querySelector("#selectionNormalContainer").style.display = "none";
|
|
|
|
document.querySelector("#selectionVanillaContainer").style.display = "flex";
|
|
|
|
document.querySelector("#selectionVanillaContainer").style.display = "flex";
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
@ -926,18 +965,36 @@ function vanillaSelection() {
|
|
|
|
if (element.children[0].innerHTML !== "")
|
|
|
|
if (element.children[0].innerHTML !== "")
|
|
|
|
element.children[1].className = "fa fa-play";
|
|
|
|
element.children[1].className = "fa fa-play";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector(".sel1").onclick = function () {
|
|
|
|
|
|
|
|
wait('vanillaFacile', document.querySelector(".sel1"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".sel2").onclick = function () {
|
|
|
|
|
|
|
|
wait('vanillaMoyen', document.querySelector(".sel2"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".sel3").onclick = function () {
|
|
|
|
|
|
|
|
wait('vanillaImpossible', document.querySelector(".sel3"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function normalSelection() {
|
|
|
|
function normalSelection() {
|
|
|
|
document.querySelector("#title_selection_2").innerHTML = "Normal";
|
|
|
|
document.querySelector("#selectionNormalContainer").style.display = "none";
|
|
|
|
document.querySelector("#selectionVanillaContainer").style.display = "none";
|
|
|
|
document.querySelector("#selectionVanillaContainer").style.display = "flex";
|
|
|
|
document.querySelector("#selectionNormalContainer").style.display = "flex";
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
document.querySelectorAll(".vanillaElement").forEach(function (element) {
|
|
|
|
document.querySelectorAll(".vanillaElement").forEach(function (element) {
|
|
|
|
if (element.children[0].innerHTML !== "")
|
|
|
|
if (element.children[0].innerHTML !== "")
|
|
|
|
element.children[1].className = "fa fa-play";
|
|
|
|
element.children[1].className = "fa fa-play";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
document.querySelector(".sel1").onclick = function () {
|
|
|
|
|
|
|
|
wait('normalFacile', document.querySelector(".sel1"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".sel2").onclick = function () {
|
|
|
|
|
|
|
|
wait('normalMoyen', document.querySelector(".sel2"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".sel3").onclick = function () {
|
|
|
|
|
|
|
|
wait('normalImpossible', document.querySelector(".sel3"))
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function playVanilla() {
|
|
|
|
function playVanilla() {
|
|
|
@ -949,48 +1006,85 @@ function playVanilla() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function playFacileVanilla() {
|
|
|
|
function playFacileVanilla() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
|
|
|
|
wait('vanillaFacile' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('vanillaFacile' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
niveauActuel = 1;
|
|
|
|
timeTot = 0;
|
|
|
|
timeTot = 0;
|
|
|
|
launchFacileGameOne("vanillaFacile");
|
|
|
|
launchFacileGameOne("vanillaFacile");*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function playImpossibleVanilla() {
|
|
|
|
function playImpossibleVanilla() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
timeTot = 0;
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
launchImpossibleGameOne("vanillaImpossible");
|
|
|
|
wait('vanillaImpossible' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('vanillaImpossible' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Vanilla
|
|
|
|
function playMoyenVanilla() {
|
|
|
|
function playMoyenVanilla() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
timeTot = 0;
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
launchMoyenGameOne("vanillaMoyen");
|
|
|
|
wait('vanillaMoyen' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('vanillaMoyen' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//normal
|
|
|
|
//normal
|
|
|
|
function playFacileNormal() {
|
|
|
|
function playFacileNormal() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileGameOne("normalFacile");
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
|
|
|
|
wait('normalFacile' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('normalFacile' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function playImpossibleNormal() {
|
|
|
|
function playImpossibleNormal() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
timeTot = 0;
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
launchImpossibleGameOne("normalImpossible");
|
|
|
|
wait('normalImpossible' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('normalImpossible' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function playMoyenNormal() {
|
|
|
|
function playMoyenNormal() {
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#VanillalevelSelectionPage"));
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
showDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
niveauActuel = 1;
|
|
|
|
for (let i = 1; i < 6; i++) {
|
|
|
|
timeTot = 0;
|
|
|
|
document.querySelector(".chap" + i).onclick = function () {
|
|
|
|
launchMoyenGameOne("normalMoyen");
|
|
|
|
wait('normalMoyen' + i, document.querySelector(".chap" + i))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(".chap" + i + "Score").onclick = function () {
|
|
|
|
|
|
|
|
leaderboard('normalMoyen' + i, document.querySelector(".chap" + i + "Score"))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function modeTuto() {
|
|
|
|
function modeTuto() {
|
|
|
@ -1023,12 +1117,253 @@ function WarningMessage(message) {
|
|
|
|
document.querySelector(".fa-info-circle").style.display = "block";
|
|
|
|
document.querySelector(".fa-info-circle").style.display = "block";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Facile
|
|
|
|
|
|
|
|
function playFacile1() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileChapitre1(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playFacile2() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileChapitre2(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playFacile3() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileChapitre3(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playFacile4() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileChapitre4(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playFacile5() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchFacileChapitre5(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//Moyen
|
|
|
|
|
|
|
|
function playMoyen1() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchMoyenChapitre1(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playMoyen2() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchMoyenChapitre2(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playMoyen3() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchMoyenChapitre3(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playMoyen4() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchMoyenChapitre4(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playMoyen5() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchMoyenChapitre5(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Impossible
|
|
|
|
|
|
|
|
function playImpossible1() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchImpossibleChapitre1(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playImpossible2() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchImpossibleChapitre2(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playImpossible3() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchImpossibleChapitre3(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playImpossible4() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchImpossibleChapitre4(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function playImpossible5() {
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
|
|
|
|
showDiv(document.querySelector("#playPage"));
|
|
|
|
|
|
|
|
niveauActuel = 1;
|
|
|
|
|
|
|
|
timeTot = 0;
|
|
|
|
|
|
|
|
launchImpossibleChapitre5(modeG);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function wait(mode, btn) {
|
|
|
|
function wait(mode, btn) {
|
|
|
|
|
|
|
|
document.querySelector("#lose_pannel").style.display = "none";
|
|
|
|
|
|
|
|
isFinish = false;
|
|
|
|
var time = 300;
|
|
|
|
var time = 300;
|
|
|
|
spin(btn);
|
|
|
|
spin(btn);
|
|
|
|
|
|
|
|
modeG = mode;
|
|
|
|
switch (mode) {
|
|
|
|
switch (mode) {
|
|
|
|
|
|
|
|
//Normal
|
|
|
|
|
|
|
|
case "normalFacile1":
|
|
|
|
|
|
|
|
setTimeout(playFacile1, time);
|
|
|
|
|
|
|
|
setMode("Normal Facile - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalFacile2":
|
|
|
|
|
|
|
|
setTimeout(playFacile2, time);
|
|
|
|
|
|
|
|
setMode("Normal Facile - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalFacile3":
|
|
|
|
|
|
|
|
setTimeout(playFacile3, time);
|
|
|
|
|
|
|
|
setMode("Normal Facile - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalFacile4":
|
|
|
|
|
|
|
|
setTimeout(playFacile4, time);
|
|
|
|
|
|
|
|
setMode("Normal Facile - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalFacile5":
|
|
|
|
|
|
|
|
setTimeout(playFacile5, time);
|
|
|
|
|
|
|
|
setMode("Normal Facile - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
//normal Moyen
|
|
|
|
|
|
|
|
case "normalMoyen1":
|
|
|
|
|
|
|
|
setTimeout(playMoyen1, time);
|
|
|
|
|
|
|
|
setMode("Normal Moyen - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalMoyen2":
|
|
|
|
|
|
|
|
setTimeout(playMoyen2, time);
|
|
|
|
|
|
|
|
setMode("Normal Moyen - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalMoyen3":
|
|
|
|
|
|
|
|
setTimeout(playMoyen3, time);
|
|
|
|
|
|
|
|
setMode("Normal Moyen - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaMoyen4":
|
|
|
|
|
|
|
|
setTimeout(playMoyen4, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalMoyen5":
|
|
|
|
|
|
|
|
setTimeout(playMoyen5, time);
|
|
|
|
|
|
|
|
setMode("Normal Moyen - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
//Impossible
|
|
|
|
|
|
|
|
case "normalImpossible1":
|
|
|
|
|
|
|
|
setTimeout(playImpossible1, time);
|
|
|
|
|
|
|
|
setMode("Normal Impossible - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalImpossible2":
|
|
|
|
|
|
|
|
setTimeout(playImpossible2, time);
|
|
|
|
|
|
|
|
setMode("Normal Impossible - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalImpossible3":
|
|
|
|
|
|
|
|
setTimeout(playImpossible3, time);
|
|
|
|
|
|
|
|
setMode("Normal Impossible - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalImpossible4":
|
|
|
|
|
|
|
|
setTimeout(playImpossible4, time);
|
|
|
|
|
|
|
|
setMode("Normal Impossible - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "normalImpossible5":
|
|
|
|
|
|
|
|
setTimeout(playImpossible5, time);
|
|
|
|
|
|
|
|
setMode("Normal Impossible - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Vanilla
|
|
|
|
|
|
|
|
//Vanilla Facile
|
|
|
|
|
|
|
|
case "vanillaFacile1":
|
|
|
|
|
|
|
|
setTimeout(playFacile1, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Facile - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaFacile2":
|
|
|
|
|
|
|
|
setTimeout(playFacile2, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Facile - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaFacile3":
|
|
|
|
|
|
|
|
setTimeout(playFacile3, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Facile - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaFacile4":
|
|
|
|
|
|
|
|
setTimeout(playFacile4, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Facile - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaFacile5":
|
|
|
|
|
|
|
|
setTimeout(playFacile5, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Facile - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
//Vanilla Moyen
|
|
|
|
|
|
|
|
case "vanillaMoyen1":
|
|
|
|
|
|
|
|
setTimeout(playMoyen1, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaMoyen2":
|
|
|
|
|
|
|
|
setTimeout(playMoyen2, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaMoyen3":
|
|
|
|
|
|
|
|
setTimeout(playMoyen3, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaMoyen4":
|
|
|
|
|
|
|
|
setTimeout(playMoyen4, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaMoyen5":
|
|
|
|
|
|
|
|
setTimeout(playMoyen5, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Moyen - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
//Impossible
|
|
|
|
|
|
|
|
case "vanillaImpossible1":
|
|
|
|
|
|
|
|
setTimeout(playImpossible1, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Impossible - Chapitre 1");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaImpossible2":
|
|
|
|
|
|
|
|
setTimeout(playImpossible2, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Impossible - Chapitre 2");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaImpossible3":
|
|
|
|
|
|
|
|
setTimeout(playImpossible3, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Impossible - Chapitre 3");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaImpossible4":
|
|
|
|
|
|
|
|
setTimeout(playImpossible4, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Impossible - Chapitre 4");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "vanillaImpossible5":
|
|
|
|
|
|
|
|
setTimeout(playImpossible5, time);
|
|
|
|
|
|
|
|
setMode("Vanilla Impossible - Chapitre 5");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
//Autre
|
|
|
|
case "vanillaInfini":
|
|
|
|
case "vanillaInfini":
|
|
|
|
setTimeout(playVanilla, time);
|
|
|
|
setTimeout(playVanilla, time);
|
|
|
|
setMode("Vanilla Infini");
|
|
|
|
setMode("Vanilla Infini");
|
|
|
@ -1036,36 +1371,44 @@ function wait(mode, btn) {
|
|
|
|
case "vanillaFacile":
|
|
|
|
case "vanillaFacile":
|
|
|
|
setTimeout(playFacileVanilla, time);
|
|
|
|
setTimeout(playFacileVanilla, time);
|
|
|
|
setMode("Vanilla Facile");
|
|
|
|
setMode("Vanilla Facile");
|
|
|
|
|
|
|
|
setTitle("Vanilla Facile");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "vanillaImpossible":
|
|
|
|
case "vanillaImpossible":
|
|
|
|
setTimeout(playImpossibleVanilla, time);
|
|
|
|
setTimeout(playImpossibleVanilla, time);
|
|
|
|
|
|
|
|
setTitle("Vanilla Impossible");
|
|
|
|
setMode("Vanilla Impossible");
|
|
|
|
setMode("Vanilla Impossible");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "vanillaMoyen":
|
|
|
|
case "vanillaMoyen":
|
|
|
|
setTimeout(playMoyenVanilla, time);
|
|
|
|
setTimeout(playMoyenVanilla, time);
|
|
|
|
|
|
|
|
setTitle("Vanilla Moyen");
|
|
|
|
setMode("Vanilla Moyen");
|
|
|
|
setMode("Vanilla Moyen");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "normalFacile":
|
|
|
|
case "normalFacile":
|
|
|
|
setTimeout(playFacileNormal, time);
|
|
|
|
setTimeout(playFacileNormal, time);
|
|
|
|
|
|
|
|
setTitle("Normal Facile");
|
|
|
|
setMode("Normal Facile");
|
|
|
|
setMode("Normal Facile");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "normalImpossible":
|
|
|
|
case "normalImpossible":
|
|
|
|
setTimeout(playImpossibleNormal, time);
|
|
|
|
setTimeout(playImpossibleNormal, time);
|
|
|
|
|
|
|
|
setTitle("Normal Impossible");
|
|
|
|
setMode("Vanilla Impossible");
|
|
|
|
setMode("Vanilla Impossible");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "normalMoyen":
|
|
|
|
case "normalMoyen":
|
|
|
|
setTimeout(playMoyenNormal, time);
|
|
|
|
setTimeout(playMoyenNormal, time);
|
|
|
|
setMode("Normal Moyen");
|
|
|
|
setMode("Normal Moyen");
|
|
|
|
|
|
|
|
setTitle("Normal Moyen");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "normalInfini":
|
|
|
|
case "normalInfini":
|
|
|
|
setTimeout(playNormal, time);
|
|
|
|
setTimeout(playNormal, time);
|
|
|
|
setMode("Normal Infini");
|
|
|
|
setMode("Normal Infini");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "normal":
|
|
|
|
case "normal":
|
|
|
|
|
|
|
|
document.querySelector("#title_selection_2").innerHTML = "Normal";
|
|
|
|
setTimeout(normalSelection, time);
|
|
|
|
setTimeout(normalSelection, time);
|
|
|
|
setMode("Normal");
|
|
|
|
setMode("Normal");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "vanilla":
|
|
|
|
case "vanilla":
|
|
|
|
|
|
|
|
document.querySelector("#title_selection_2").innerHTML = "Vanilla";
|
|
|
|
setTimeout(vanillaSelection, time);
|
|
|
|
setTimeout(vanillaSelection, time);
|
|
|
|
setMode("Vanilla")
|
|
|
|
setMode("Vanilla")
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1541,6 +1884,11 @@ function setMode(mode) {
|
|
|
|
document.querySelector("#modeDeJeu").innerHTML = mode;
|
|
|
|
document.querySelector("#modeDeJeu").innerHTML = mode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setTitle(mode) {
|
|
|
|
|
|
|
|
console.log(mode)
|
|
|
|
|
|
|
|
document.querySelector("#testTitlSelect").innerHTML = mode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function launchTest() {
|
|
|
|
function launchTest() {
|
|
|
|
document.querySelector(".niveau").innerHTML = niveauActuel;
|
|
|
|
document.querySelector(".niveau").innerHTML = niveauActuel;
|
|
|
|
timer.stop();
|
|
|
|
timer.stop();
|
|
|
@ -1566,6 +1914,7 @@ function closeGame() {
|
|
|
|
|
|
|
|
|
|
|
|
function closeSelection() {
|
|
|
|
function closeSelection() {
|
|
|
|
showDiv(document.querySelector("#mainPage"));
|
|
|
|
showDiv(document.querySelector("#mainPage"));
|
|
|
|
|
|
|
|
hideDiv(document.querySelector("#LastSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
hideDiv(document.querySelector("#levelSelectionPage"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|