+
+
-
+
-
+
-
+
@@ -78,7 +78,7 @@
Changer le nombre de points

-
+
@@ -109,11 +109,11 @@
{
if(stristr($_POST['game_mode'], "p") === FALSE)
{
- $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select min(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
+ $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select max(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
}
else
{
- $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select max(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
+ $sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' and score=(select min(score) from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].')';
}
$result = $database->query($sql);
$a=$result->fetchArray();
diff --git a/code/index.css b/code/index.css
index fb0de52..cbbc4d8 100644
--- a/code/index.css
+++ b/code/index.css
@@ -148,4 +148,10 @@
.slot {
display: inline-block;
border: 1px solid white;
+ }
+
+ .texte {
+ font-size: xx-large;
+ font-weight: bold;
+ font-family: 'Segoe print';
}
\ No newline at end of file
diff --git a/code/index.php b/code/index.php
index ecba2c0..0b7f1c9 100644
--- a/code/index.php
+++ b/code/index.php
@@ -65,7 +65,7 @@
Changer le nombre de points

-
+
Mode d'affichage :
@@ -114,6 +114,7 @@
+
diff --git a/code/options.js b/code/options.js
index 74a66ed..2de9c12 100644
--- a/code/options.js
+++ b/code/options.js
@@ -178,17 +178,31 @@ var gemsSelected=[];
for(var cpt=0;cpt<8;cpt++)
{
gemsSelected[cpt]= (getCookie("gem"+(cpt+1))=="" ? gemsAvailable[cpt] : getCookie("gem"+(cpt+1)));
+ console.log(gemsSelected[cpt]);
}
for(var cpt=1;cpt<9;cpt++)
{
- eval("var gemIcon_"+gemsAvailable[cpt-1]+"=document.getElementById('gem"+cpt+"')");
- eval('gemIcon_'+gemsAvailable[cpt-1]+'.src="ress/'+gemsAvailable[cpt-1]+'"');
- eval('gemIcon_'+gemsAvailable[cpt-1]+'.width=size/6');
+ console.log("disp : "+gemsSelected[cpt-1]);
+ eval("var gemIcon_"+gemsSelected[cpt-1]+"=document.getElementById('gem"+cpt+"')");
+ eval('gemIcon_'+gemsSelected[cpt-1]+'.src="ress/'+gemsSelected[cpt-1]+'"');
+ eval('gemIcon_'+gemsSelected[cpt-1]+'.width=size/6');
eval("var slot"+cpt+"=document.getElementById('slot"+cpt+"')");
eval("slot"+cpt+".style.width=size/6");
eval("slot"+cpt+".style.height=size/6");
document.getElementById("slot"+cpt).appendChild(eval("gem"+cpt));
+}
+
+//document.getElementById("resetGems").width=size/2;
+document.getElementById("resetGems2").width=size/4;
+
+function resetGems()
+{
+ for(var cpt=1;cpt<9;cpt++)
+ {
+ setCookie("gem"+cpt,"",30);
+ document.getElementById("slot"+cpt).appendChild(eval("gemIcon_"+gemsAvailable[cpt-1]));
+ }
}
\ No newline at end of file
diff --git a/code/ress/+.png b/code/ress/+.png
index ec8e8da..94f2973 100644
Binary files a/code/ress/+.png and b/code/ress/+.png differ
diff --git a/code/ress/-.png b/code/ress/-.png
index 5d76e09..eadd0e2 100644
Binary files a/code/ress/-.png and b/code/ress/-.png differ
diff --git a/code/ress/reset.png b/code/ress/reset.png
new file mode 100644
index 0000000..b90132d
Binary files /dev/null and b/code/ress/reset.png differ
diff --git a/code/ress/reset_dark.png b/code/ress/reset_dark.png
new file mode 100644
index 0000000..66a100c
Binary files /dev/null and b/code/ress/reset_dark.png differ
diff --git a/code/ress/reset_light.png b/code/ress/reset_light.png
new file mode 100644
index 0000000..d6f9b49
Binary files /dev/null and b/code/ress/reset_light.png differ
diff --git a/code/score.php b/code/score.php
index 91134cc..c18760b 100644
--- a/code/score.php
+++ b/code/score.php
@@ -17,11 +17,11 @@ Votre score est :
$database = new SQLite3("data.db");
if(stristr($_GET['mode'], "p") === FALSE)
{
- $sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select min(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
+ $sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select max(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
}
else
{
- $sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select max(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
+ $sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select min(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
}
$result = $database->query($sql);
@@ -46,11 +46,11 @@ if($_GET['pseudo']!="")
{
if(stristr($_GET['mode'], "p") === FALSE) // vérification du mode pour afficher le score le plus grand ou le plus petit (- de temps = + de score)
{ //il n'y a pas "p" dans le mode, donc on cherche le plus haut score
- $sqlScore='select min(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and player="'.$_GET['pseudo'].'"';
+ $sqlScore='select max(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and player="'.$_GET['pseudo'].'"';
}
else
{ // on est en points, donc on cherche le temps le plus faible
- $sqlScore='select max(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and player="'.$_GET['pseudo'].'"';
+ $sqlScore='select min(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and player="'.$_GET['pseudo'].'"';
}
$result = $database->query($sqlScore); // on prend le meilleur score du joueur
$data = $result->fetchArray()[0];
diff --git a/code/themeSwitcher.js b/code/themeSwitcher.js
index c295adf..12f432d 100644
--- a/code/themeSwitcher.js
+++ b/code/themeSwitcher.js
@@ -21,6 +21,11 @@ function applyLight(li) {
document.getElementById("modal").classList.add((li=="true" ? "day" : "night"));
document.getElementById("modal").classList.remove((li=="true" ? "night" : "day"));
}
+
+ if(document.getElementById("resetGems")!=null)
+ {
+ document.getElementById("resetGems").src="ress/reset_"+(li=="true" ? "light" : "dark")+".png";
+ }
document.getElementsByTagName("body")[0].classList.add((li=="true" ? "day" : "night"));
document.getElementsByTagName("body")[0].classList.remove((li=="true" ? "night" : "day"));