mirror of
https://github.com/Cpt-Adok/SNAKE.git
synced 2026-03-31 10:21:35 +00:00
changement de tout le programme avec ajout de plein de nouvelle chose et coorection de chose pour le rendre plus pratique
This commit is contained in:
@@ -2,14 +2,13 @@ package tests;
|
||||
|
||||
import display.Display;
|
||||
import environnements.Map;
|
||||
import object.Items;
|
||||
import personnages.Personnage;
|
||||
import personnages.Player;
|
||||
import types.Item;
|
||||
|
||||
public class MapTest {
|
||||
public static void creationMap() {
|
||||
Map map = new Map(30, 30);
|
||||
map.addObjects(Items.FRAISE, 29, 29);
|
||||
map.addObjects(Item.FRAISE, 29, 29);
|
||||
map.placeObjects();
|
||||
|
||||
Display.printMap(map.addEdges());
|
||||
@@ -17,20 +16,20 @@ public class MapTest {
|
||||
|
||||
public static void drawMap() {
|
||||
Map map = new Map(30, 30);
|
||||
Display.printMap(map.addEdges(), null);
|
||||
Display.printMap(map.addEdges());
|
||||
}
|
||||
|
||||
public static void placePersonnageMap() {
|
||||
Map map = new Map(30, 30);
|
||||
map.placePersonnages(new Player(new int[]{1, 1}, "null"));
|
||||
|
||||
Display.printMap(map.addEdges(), new Personnage[] {new Player(new int[]{1, 1}, "null")});
|
||||
Display.printMap(map.addEdges());
|
||||
}
|
||||
|
||||
public static void effects() {
|
||||
Map map = new Map(5, 1);
|
||||
Player player = new Player(new int[] {0, 0}, "null");
|
||||
map.addObjects(Items.FRAISE, 0, 0);
|
||||
map.addObjects(Item.FRAISE, 0, 0);
|
||||
|
||||
player.applyEffects(map.getEffect(player.getHeadCoordinate()));
|
||||
System.out.println(player.getSize());
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package tests;
|
||||
|
||||
import object.Effects;
|
||||
import object.Mouvements;
|
||||
import personnages.Personnage;
|
||||
import personnages.Player;
|
||||
import types.Effect;
|
||||
import types.Mouvement;
|
||||
|
||||
public class PersonnageTest {
|
||||
public static void avancerPersonnage() {
|
||||
Player player = new Player(new int[]{1, 1}, "test");
|
||||
|
||||
player.moveSnake(Mouvements.HAUT); // si la position s'est avancé, c'est normal
|
||||
player.moveSnake(Mouvement.HAUT); // si la position s'est avancé, c'est normal
|
||||
int[] coordinate = player.getHeadCoordinate();
|
||||
|
||||
System.out.println(coordinate[0] + " " + coordinate[1]);
|
||||
@@ -20,18 +20,18 @@ public class PersonnageTest {
|
||||
|
||||
Player player = new Player(new int[]{1, 1}, "test");
|
||||
player.increaseRound();
|
||||
player.moveSnake(Mouvements.HAUT); // si il y a 2 valeurs, c'est normal
|
||||
player.moveSnake(Mouvement.HAUT); // si il y a 2 valeurs, c'est normal
|
||||
|
||||
for (int[] coordinate : player.getCoordinate()) {
|
||||
System.out.println(coordinate[0] + " " + coordinate[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public static void effectsPersonnage() {
|
||||
public static void effectPersonnage() {
|
||||
Personnage.n = 2;
|
||||
|
||||
Player player = new Player(new int[]{1, 1}, "test");
|
||||
player.applyEffects(Effects.DECREASESIZE); // si c'est vide c'est que ça marche
|
||||
player.applyEffects(Effect.DECREASESIZE); // si c'est vide c'est que ça marche
|
||||
|
||||
System.out.println(player.getCoordinate());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user