Skip to content
Snippets Groups Projects
Commit b8d70eff authored by HydroFlo's avatar HydroFlo
Browse files

fin score visu + bug au boss corige

parent 3f9a5166
Branches
No related tags found
No related merge requests found
No preview for this file type
################################################################################ ################################################################################
####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#### ####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@####
#### ____ #### ####@ ____ @####
#### / ___| ___ ___ _ __ ___ #### #### / ___| ___ ___ _ __ ___ ####
#### \___ \ / __/ _ \| '__/ _ \ #### #### \___ \ / __/ _ \| '__/ _ \ ####
#### ___) | (_| (_) | | | __/ #### #### ___) | (_| (_) | | | __/ ####
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
#### #### #### ####
#### #### #### ####
#### Pseudo : Score : #### #### Pseudo : Score : ####
#### ####
\ No newline at end of file
Pseudo,Score Pseudo,Score
j,91
Hydro,38 Hydro,38
Alex,37 Alex,37
Bob,37 Bob,37
Testeur,34 Testeur,34
Test,32 Test,32
Cheh,31
...@@ -84,7 +84,7 @@ class Labyrinthe extends Program{ ...@@ -84,7 +84,7 @@ class Labyrinthe extends Program{
String choix; String choix;
do{ do{
choix = toLowerCase(readString()); choix = toLowerCase(readString());
}while(length(choix) != 1 && length(choix) != 2); }while(length(choix) != 1 && length(choix) != 2 );
return choix; return choix;
} }
...@@ -267,7 +267,7 @@ class Labyrinthe extends Program{ ...@@ -267,7 +267,7 @@ class Labyrinthe extends Program{
} else { } else {
j.vie -= 10; j.vie -= 10;
} }
} else if(Lab[positionL-1][positionC] == 'B'){ //Si Monstre, affiche la question. } else if(Lab[positionL-1][positionC] == 'B' && !j.bossVaincu){ //Si Monstre, affiche la question.
Question q = questionRandom(listeBoss, 0); Question q = questionRandom(listeBoss, 0);
afficheQuestion(q, true); afficheQuestion(q, true);
if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre
...@@ -296,7 +296,7 @@ class Labyrinthe extends Program{ ...@@ -296,7 +296,7 @@ class Labyrinthe extends Program{
} else { } else {
j.vie -= 10; j.vie -= 10;
} }
} else if(Lab[positionL+1][positionC] == 'B'){ //Si Monstre, affiche la question. } else if(Lab[positionL+1][positionC] == 'B' && !j.bossVaincu){ //Si Monstre, affiche la question.
Question q = questionRandom(listeBoss, 0); Question q = questionRandom(listeBoss, 0);
afficheQuestion(q, true); afficheQuestion(q, true);
if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre
...@@ -325,7 +325,7 @@ class Labyrinthe extends Program{ ...@@ -325,7 +325,7 @@ class Labyrinthe extends Program{
} else { } else {
j.vie -= 10; j.vie -= 10;
} }
} else if(Lab[positionL][positionC-1] == 'B'){ //Si Monstre, affiche la question. } else if(Lab[positionL][positionC-1] == 'B' && !j.bossVaincu){ //Si Monstre, affiche la question.
Question q = questionRandom(listeBoss, 0); Question q = questionRandom(listeBoss, 0);
afficheQuestion(q, true); afficheQuestion(q, true);
if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre
...@@ -354,7 +354,7 @@ class Labyrinthe extends Program{ ...@@ -354,7 +354,7 @@ class Labyrinthe extends Program{
} else { } else {
j.vie -= 10; j.vie -= 10;
} }
} else if(Lab[positionL][positionC+1] == 'B'){ //Si Monstre, affiche la question. } else if(Lab[positionL][positionC+1] == 'B' && !j.bossVaincu){ //Si Monstre, affiche la question.
Question q = questionRandom(listeBoss, 0); Question q = questionRandom(listeBoss, 0);
afficheQuestion(q, true); afficheQuestion(q, true);
if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre if(questionCorrect(q)){ //En cas de bonne réponse efface le monstre
...@@ -493,6 +493,7 @@ class Labyrinthe extends Program{ ...@@ -493,6 +493,7 @@ class Labyrinthe extends Program{
} }
println("#### " + file[i][0] + vide + file[i][1] + " ####"); println("#### " + file[i][0] + vide + file[i][1] + " ####");
} }
println(readFile("ressources/img/fermeEntete.txt", true));
} }
Question[] listeQuestion(String cheminFichier){ //Charge le csv des question et renvoie un tableau de question qui possède une Question par case Question[] listeQuestion(String cheminFichier){ //Charge le csv des question et renvoie un tableau de question qui possède une Question par case
...@@ -686,7 +687,7 @@ class Labyrinthe extends Program{ ...@@ -686,7 +687,7 @@ class Labyrinthe extends Program{
int[] indiceP = indiceDe('P', salle); int[] indiceP = indiceDe('P', salle);
String choix = controleSaisie(); String choix = controleSaisie();
int nbMove = 1; int nbMove = 1;
if(length(choix) == 2){ if(length(choix) == 2 && estInt(substring(choix,1,2))){
nbMove = charToInt(charAt(choix,1)); nbMove = charToInt(charAt(choix,1));
} }
for(int i = 0; i < nbMove; i ++){ for(int i = 0; i < nbMove; i ++){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment