diff --git a/Map/map1.gyro b/Map/map1.gyro new file mode 100644 index 0000000..4f1ba98 --- /dev/null +++ b/Map/map1.gyro @@ -0,0 +1,10 @@ +mmmmmmmmmmmmmmmmmmmm +m c c c m +m cmmmmc cmmm +m c c c cm +mcc cm i cmcm +mcc h bcmmmmmmmmmmcm +mcmmmmmc cm +mc cm +mc i cm +mmmmmmmmmmmmmmmmmmmm \ No newline at end of file diff --git a/Map/map2.gyro b/Map/map2.gyro new file mode 100644 index 0000000..eaef9dc --- /dev/null +++ b/Map/map2.gyro @@ -0,0 +1,10 @@ +mmmmmmmmmmmmmmmmmmmm +m c b c m +m cmmmmc mmm +m c c B cm +mcc cm Bmcm +mcc h cmmmmmmmmmmcm +mcmmmmmc cm +mc cm +mc b cm +mmmmmmmmmmmmmmmmmmmm \ No newline at end of file diff --git a/Map/map3.gyro b/Map/map3.gyro new file mode 100644 index 0000000..a09c8eb --- /dev/null +++ b/Map/map3.gyro @@ -0,0 +1,10 @@ +mmmmmmmmmmmmmmmmmmmm +mc hm +mc mmm +mc m ib m cm +mc mmmmmBmB Bmcm +mc B B cm +mc B B cm +mc B cm +mc i cm +mmmmmmmmmmmmmmmmmmmm \ No newline at end of file diff --git a/src/modele/calculs/Jeu.java b/src/modele/calculs/Jeu.java index 22d1caa..086b51b 100644 --- a/src/modele/calculs/Jeu.java +++ b/src/modele/calculs/Jeu.java @@ -67,7 +67,9 @@ public class Jeu { private void resetJeu() { grilleEntites = new ObjetGyromide[SIZE_X][SIZE_Y][2]; map.clear(); + Controle4Directions.getInstance().lstEntitesDynamiques.clear(); hector = null; + nombreDeBombe = 0; } public Heros getHector() { @@ -79,7 +81,8 @@ public class Jeu { this.state = 2; getOrdonnanceur().clear(); resetJeu(); - LecteurFichier.loadMap("Map/test.gyro", this); + mapCourante = 1; + LecteurFichier.loadMap("Map/map1.gyro", this); } public void startTitleScreen() { @@ -89,6 +92,19 @@ public class Jeu { ordonnanceur.add(ControleMenu.getInstance()); } + public void niveauReussi() { + this.state = 2; + getOrdonnanceur().clear(); + resetJeu(); + if(NBR_DE_MAP > mapCourante) { + mapCourante++; + LecteurFichier.loadMap("Map/map" + mapCourante + ".gyro", this); + } else { + startTitleScreen(); + System.out.println("C'est gagné"); + } + } + // PARTIE MANIPULATIONS ENTITE public void addEntite(ObjetGyromide e, int x, int y) { if(e instanceof ElementFond) @@ -247,6 +263,11 @@ public class Jeu { grilleEntites[pCourant.x][pCourant.y][1] = null; map.remove(elt); + + if(elt instanceof Bombe) + if (--nombreDeBombe == 0) + niveauReussi(); + } /** Indique si p est contenu dans la grille