diff --git a/code/ressources/image/creature/bear1.1.png b/code/ressources/image/creature/bear1.1.png new file mode 100644 index 0000000..844fa94 Binary files /dev/null and b/code/ressources/image/creature/bear1.1.png differ diff --git a/code/ressources/image/creature/bear1.10.png b/code/ressources/image/creature/bear1.10.png new file mode 100644 index 0000000..70dc7d0 Binary files /dev/null and b/code/ressources/image/creature/bear1.10.png differ diff --git a/code/ressources/image/creature/bear1.11.png b/code/ressources/image/creature/bear1.11.png new file mode 100644 index 0000000..3ef9bc5 Binary files /dev/null and b/code/ressources/image/creature/bear1.11.png differ diff --git a/code/ressources/image/creature/bear1.12.png b/code/ressources/image/creature/bear1.12.png new file mode 100644 index 0000000..0591902 Binary files /dev/null and b/code/ressources/image/creature/bear1.12.png differ diff --git a/code/ressources/image/creature/bear1.2.png b/code/ressources/image/creature/bear1.2.png new file mode 100644 index 0000000..54b9654 Binary files /dev/null and b/code/ressources/image/creature/bear1.2.png differ diff --git a/code/ressources/image/creature/bear1.3.png b/code/ressources/image/creature/bear1.3.png new file mode 100644 index 0000000..d5e4743 Binary files /dev/null and b/code/ressources/image/creature/bear1.3.png differ diff --git a/code/ressources/image/creature/bear1.4.png b/code/ressources/image/creature/bear1.4.png new file mode 100644 index 0000000..2c95f37 Binary files /dev/null and b/code/ressources/image/creature/bear1.4.png differ diff --git a/code/ressources/image/creature/bear1.5.png b/code/ressources/image/creature/bear1.5.png new file mode 100644 index 0000000..50cc075 Binary files /dev/null and b/code/ressources/image/creature/bear1.5.png differ diff --git a/code/ressources/image/creature/bear1.6.png b/code/ressources/image/creature/bear1.6.png new file mode 100644 index 0000000..e6a1a0e Binary files /dev/null and b/code/ressources/image/creature/bear1.6.png differ diff --git a/code/ressources/image/creature/bear1.7.png b/code/ressources/image/creature/bear1.7.png new file mode 100644 index 0000000..bc08fa7 Binary files /dev/null and b/code/ressources/image/creature/bear1.7.png differ diff --git a/code/ressources/image/creature/bear1.8.png b/code/ressources/image/creature/bear1.8.png new file mode 100644 index 0000000..58887a1 Binary files /dev/null and b/code/ressources/image/creature/bear1.8.png differ diff --git a/code/ressources/image/creature/bear1.9.png b/code/ressources/image/creature/bear1.9.png new file mode 100644 index 0000000..c57e9de Binary files /dev/null and b/code/ressources/image/creature/bear1.9.png differ diff --git a/code/ressources/image/creature/goat1.1.png b/code/ressources/image/creature/goat1.1.png new file mode 100644 index 0000000..a00e5ee Binary files /dev/null and b/code/ressources/image/creature/goat1.1.png differ diff --git a/code/ressources/image/creature/goat1.10.png b/code/ressources/image/creature/goat1.10.png new file mode 100644 index 0000000..c05b5b7 Binary files /dev/null and b/code/ressources/image/creature/goat1.10.png differ diff --git a/code/ressources/image/creature/goat1.11.png b/code/ressources/image/creature/goat1.11.png new file mode 100644 index 0000000..595aed6 Binary files /dev/null and b/code/ressources/image/creature/goat1.11.png differ diff --git a/code/ressources/image/creature/goat1.12.png b/code/ressources/image/creature/goat1.12.png new file mode 100644 index 0000000..9ac1ecc Binary files /dev/null and b/code/ressources/image/creature/goat1.12.png differ diff --git a/code/ressources/image/creature/goat1.2.png b/code/ressources/image/creature/goat1.2.png new file mode 100644 index 0000000..ef7a082 Binary files /dev/null and b/code/ressources/image/creature/goat1.2.png differ diff --git a/code/ressources/image/creature/goat1.3.png b/code/ressources/image/creature/goat1.3.png new file mode 100644 index 0000000..8fa340d Binary files /dev/null and b/code/ressources/image/creature/goat1.3.png differ diff --git a/code/ressources/image/creature/goat1.4.png b/code/ressources/image/creature/goat1.4.png new file mode 100644 index 0000000..b76ada9 Binary files /dev/null and b/code/ressources/image/creature/goat1.4.png differ diff --git a/code/ressources/image/creature/goat1.5.png b/code/ressources/image/creature/goat1.5.png new file mode 100644 index 0000000..98ba819 Binary files /dev/null and b/code/ressources/image/creature/goat1.5.png differ diff --git a/code/ressources/image/creature/goat1.6.png b/code/ressources/image/creature/goat1.6.png new file mode 100644 index 0000000..43dcb50 Binary files /dev/null and b/code/ressources/image/creature/goat1.6.png differ diff --git a/code/ressources/image/creature/goat1.7.png b/code/ressources/image/creature/goat1.7.png new file mode 100644 index 0000000..31a46f9 Binary files /dev/null and b/code/ressources/image/creature/goat1.7.png differ diff --git a/code/ressources/image/creature/goat1.8.png b/code/ressources/image/creature/goat1.8.png new file mode 100644 index 0000000..bc96a34 Binary files /dev/null and b/code/ressources/image/creature/goat1.8.png differ diff --git a/code/ressources/image/creature/goat1.9.png b/code/ressources/image/creature/goat1.9.png new file mode 100644 index 0000000..0797672 Binary files /dev/null and b/code/ressources/image/creature/goat1.9.png differ diff --git a/code/ressources/image/creature/void.png b/code/ressources/image/creature/void.png new file mode 100644 index 0000000..68e612f Binary files /dev/null and b/code/ressources/image/creature/void.png differ diff --git a/code/src/controller/CreatureController.java b/code/src/controller/CreatureController.java index d0bf67c..79d33b2 100644 --- a/code/src/controller/CreatureController.java +++ b/code/src/controller/CreatureController.java @@ -52,20 +52,17 @@ public class CreatureController { //creatureImageView.setImage(dog1); } if(animal == 2) { - this.creature = new Creature(2,"/image/personnage/Perso1.",0,0 ); + this.creature = new Creature(2,"/image/creature/bear1.",0,0 ); } if(animal == 3) { - this.creature = new Creature(2,"/image/personnage/Perso2.",0,0 ); - } - if(animal == 4) { - this.creature = new Creature(2,"/image/personnage/Perso3.",0,0 ); + this.creature = new Creature(2,"/image/creature/goat1.",0,0 ); } } public void playerInitialisation() throws InterruptedException { mapCreatureController = new MapCreatureController(lv, map); mapCreatureController.creerMapCreature(); - int max = 4; + int max = 3; int min = 1; double a = Math.random() * ( max - min ); int numCreature = (int) Math.round(a) + min; @@ -98,6 +95,9 @@ public class CreatureController { } catch (InterruptedException e) { e.printStackTrace(); } + if(i==mapCreatureController.getSizeListeCase()-2) { + creatureImageView.setImage(new Image("/image/creature/void.png")); + } } } }; diff --git a/code/src/controller/MapCreatureController.java b/code/src/controller/MapCreatureController.java index 43f78f9..e11113d 100644 --- a/code/src/controller/MapCreatureController.java +++ b/code/src/controller/MapCreatureController.java @@ -14,16 +14,27 @@ public class MapCreatureController { this.map = map; } public void creerMapCreature() { - int[][] coordLv1 = {{0,-1},{0,0},{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0},{9,-1}}; + int[][] coord1Lv1 = {{0,-1},{0,0},{1,0},{2,0},{3,0},{3,1},{4,1},{5,1},{6,1},{7,1},{8,1},{9,1},{9,2},{10,2},{11,2},{12,2},{13,2},{14,2},{15,2},{16,2},{17,2},{18,2},{19,2},{20,2},{21,2},{21,3},{21,4},{22,4},{23,4},{24,4},{25,4},{25,5},{25,6},{26,6},{27,6},{28,6},{28,7},{28,8},{28,9},{28,10},{28,11},{28,12},{29,12},{30,12}}; + int[][] coord2Lv1 = {{30,27},{29,27},{28,27},{27,27},{26,27},{25,27},{24,27},{23,27},{23,26},{22,26},{21,26},{20,26},{20,25},{19,25},{18,25},{17,25},{16,25},{15,25},{14,25},{13,25},{13,24},{12,24},{11,24},{10,24},{9,24},{8,24},{7,24},{6,24},{6,25},{6,26},{5,26},{4,26},{3,26},{2,26},{1,26},{-1,26},{-2,26}}; //int[][] coordLv1 = {{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0},{8,0},{9,0}}; //int[][] coordLv1 = {{0,24},{1,24},{2,24},{3,24},{4,24},{5,24},{5,23},{5,22},{5,21},{5,20},{5,19},{5,18},{6,18},{7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{12,17},{12,16},{12,15},{12,14},{12,13},{12,12},{11,12},{10,12},{9,12},{8,12},{7,12},{6,12},{5,12},{4,12},{3,12},{3,11},{3,10},{3,9},{3,8},{3,7},{3,6},{3,5},{3,4},{3,3},{4,3},{5,3},{6,3},{7,3},{8,3},{9,3},{10,3},{11,3},{12,3},{13,3},{14,3},{15,3},{16,3},{17,3},{18,3},{19,3},{19,4},{19,5},{19,6},{19,7},{19,8},{19,9},{19,10},{20,10},{21,10},{22,10},{23,10},{24,10},{24,11},{24,12},{24,13},{24,14},{24,15},{24,16},{24,17},{24,18},{24,19},{24,20},{24,21},{24,22},{24,23},{24,24},{25,24},{26,24},{27,24},{28,24},{29,24}}; mapCreature = new MapCreature(map.getSizeTile(), map.getSizeMap()); + int max = 2; + int min = 1; + double a = Math.random() * ( max - min ); + int numCreature = (int) Math.round(a) + min; + if(lv == 1) { int j = 1; - coordList = coordLv1; + if(numCreature == 1) { + coordList = coord1Lv1; + } + if (numCreature == 2) { + coordList = coord2Lv1; + } for(int[] i : coordList){ boolean bool = j == 1; System.out.println("Taille case creature :" +coordList.length); diff --git a/code/src/model/GameLoop.java b/code/src/model/GameLoop.java index 124114c..589a5e4 100644 --- a/code/src/model/GameLoop.java +++ b/code/src/model/GameLoop.java @@ -24,7 +24,7 @@ public class GameLoop { c = new CreatureController(lv,map, creatureImageView); timer = new Thread("timer") { public void run() { - int nbMinutes = 10; + int nbSeconde = 40; int i = 0; while(true) { if(i == 0) { @@ -34,7 +34,7 @@ public class GameLoop { e.printStackTrace(); } System.out.println("Timer = " + i); - i = 60 * nbMinutes; + i = nbSeconde; try { timer.sleep(1000); } catch (InterruptedException e) {