diff --git a/code/data.db b/code/data.db new file mode 100644 index 0000000..ca1fcc4 Binary files /dev/null and b/code/data.db differ diff --git a/code/db/test b/code/db/test new file mode 100644 index 0000000..76490ad Binary files /dev/null and b/code/db/test differ diff --git a/code/db/test.db b/code/db/test.db new file mode 100644 index 0000000..b752d92 Binary files /dev/null and b/code/db/test.db differ diff --git a/code/game.php b/code/game.php deleted file mode 100644 index b692473..0000000 --- a/code/game.php +++ /dev/null @@ -1,50 +0,0 @@ - - - - - On The Dot - - - - - - - - - - diff --git a/code/index.html b/code/index.html index db70ffb..eacb8be 100644 --- a/code/index.html +++ b/code/index.html @@ -37,7 +37,7 @@
Partie en points : la partie finit quand vous obtenez le nombre de points choisi. Mettez le moins de temps possible !
Partie en temps : la partie finit quand le temps imparti est écoulé. Obtenez le plus de points possible !
- Partie en survie : la partise finit quand le temps atteint 0. Gagner un point vous rajoute 30s, obtenez le plus de points possible !
+ Partie en survie : la partie finit quand le temps atteint 0. Gagner un point vous rajoute 30s, obtenez le plus de points possible !
diff --git a/code/ress/logo_clair.png b/code/ress/logo_clair.png new file mode 100644 index 0000000..d44153b Binary files /dev/null and b/code/ress/logo_clair.png differ diff --git a/code/score.html b/code/score.html deleted file mode 100644 index a635eef..0000000 --- a/code/score.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - Votre score est :

- - - diff --git a/code/score.php b/code/score.php new file mode 100644 index 0000000..b6603e6 --- /dev/null +++ b/code/score.php @@ -0,0 +1,21 @@ + + + + + + + + Votre score est :

+
+Le record est : + query($sql); + echo $result->fetchArray()[0]; + ?> + + + diff --git a/code/selecteur.js b/code/selecteur.js index a313180..868dbe2 100644 --- a/code/selecteur.js +++ b/code/selecteur.js @@ -37,15 +37,5 @@ else if(get['mode']=="surv") tpsRem=[0,1,0]; document.getElementById("chronotime").style.display="none"; } -if(get['diff']=="easy") -{ - -} -else if(get['diff']=='med') -{ -} -else if(get['diff']=='hard') -{ - -} \ No newline at end of file +diff=get["diff"]; \ No newline at end of file diff --git a/code/vitraux.js b/code/vitraux.js index 9b0fbee..a3acb5f 100644 --- a/code/vitraux.js +++ b/code/vitraux.js @@ -236,7 +236,7 @@ var canvasT = document.getElementById('canvasTotal'); empiler(); } - function getRandomInt(max) { + function getRandomInt(max) { //rng entier [1;max] return Math.floor(Math.random() * Math.floor(max))+1; } @@ -249,16 +249,31 @@ var canvasT = document.getElementById('canvasTotal'); return newArray } - function generate(diff="easy"){ + function generate(){ tabObj=[copyMDArray(tab1),copyMDArray(tab2),copyMDArray(tab3),copyMDArray(tab4)]; tabObjCmp=[]; - actions=getRandomInt(4)+1; - if(diff=="med") - actions+=getRandomInt(3)+3; - if(diff=="hard") - actions+=getRandomInt(5)+5; + var actions=getRandomInt(4)+1; + var swapTreshold=10; + var switchTreshold=10;; + if(diff=="med") //70% tournerD, 30% swap + { + actions+=getRandomInt(3)+3; + swapTreshold=8; + } + if(diff=="hard") //50% tournerD, 30% swap, 20% switch + { + actions+=getRandomInt(5)+5; + swapTreshold=6; + switchTreshold=9; + } while(actions>0){ + if(diff!="easy") + act=getRandomInt(10); + else + act=1; + + //if(switchTreshold