diff --git a/core/src/body/Platform.java b/core/src/body/Platform.java index bd209df08bf57df955f8dce22d842a6479f1dba8..9bf8ad61ecb27f4070cc4cf2fb7182df9a79e784 100644 --- a/core/src/body/Platform.java +++ b/core/src/body/Platform.java @@ -24,8 +24,7 @@ public class Platform { if (type.equals("rectangle")) { - ptsStruct = new Vector2[]{}; - + ptsStruct = new Vector2[]{new Vector2(0, 2.5f/PPM), new Vector2(10/PPM, 2.5f/PPM), new Vector2(10/PPM, 10/PPM), new Vector2(0, 10/PPM)}; shapeStruct.set(ptsStruct); } @@ -35,12 +34,12 @@ public class Platform { } if (type.equals("bord_gauche")){ - ptsStruct = new Vector2[]{}; + ptsStruct = new Vector2[]{new Vector2(0, 5/PPM), new Vector2(0, 10/PPM), new Vector2(10/PPM, 10/PPM), new Vector2(10/PPM, 2.5f/PPM), new Vector2(5/PPM, 2.5f/PPM)}; shapeStruct.set(ptsStruct); } if (type.equals("bord_droit")){ - ptsStruct = new Vector2[]{}; + ptsStruct = new Vector2[]{new Vector2(0, 2.5f/PPM), new Vector2(0, 10/PPM), new Vector2(10/PPM, 10/PPM), new Vector2(10/PPM, 5/PPM), new Vector2(5/PPM, 2.5f/PPM)}; shapeStruct.set(ptsStruct); } diff --git a/core/src/etat/Play.java b/core/src/etat/Play.java index 2d1a5ee0b87ea22b0020227da9f4da6cb3504a70..4a96181dd224752a9612c81d483ba8f9d44b2806 100644 --- a/core/src/etat/Play.java +++ b/core/src/etat/Play.java @@ -108,12 +108,44 @@ public class Play extends GameState { hauteur = Integer.parseInt(premiereLigne[1]); temps = Integer.parseInt(premiereLigne[2]); - for (int i = 1; i < (hauteur+1); i++){ + + for (int i = hauteur; i > 0; i--){ for (int j = 0; j < largeur; j++){ + System.out.print(ligne[i].charAt(j)); char current = ligne[i].charAt(j); + switch (current){ + case 'K': + new Platform((j*10)/PPM, ((hauteur-i)*10)/PPM, "rectangle", world); + break; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + new Platform((j*10)/PPM, ((hauteur-i)*10)/PPM, "carre", world); + break; + case 'L': + new Platform((j*10)/PPM, ((hauteur-i)*10)/PPM, "bord_droit", world); + break; + case 'J': + new Platform((j*10)/PPM, ((hauteur-i)*10)/PPM, "bord_gauche", world); + break; + } + } + + System.out.println(); + } + + /* for (int i = hauteur; i >= 0; i--){ + for (int j = 0; j < largeur; j++){ + char current = ligne[i-1].charAt(j); System.out.print(current); switch (current){ - /*case 'J': + *//*case 'J': new Platform(j, i, "bord_gauche", world); break; case 'K': @@ -121,7 +153,7 @@ public class Play extends GameState { break; case 'L': new Platform(j, i, "bord_droit", world); - break;*/ + break;*//* case 'A': case 'B': case 'C': @@ -131,9 +163,9 @@ public class Play extends GameState { case 'G': case 'H': case 'I': - new Platform((j*10)/PPM, ((i-1)*10)/PPM, "carre", world); + new Platform((j*10)/PPM, ((i)*10)/PPM, "carre", world); break; - /*case 'W': + *//*case 'W': new Water(j, i, world); break; case 'Z': @@ -142,12 +174,12 @@ public class Play extends GameState { case '1': case '2': //new Joyau(j, i, FabriqueUnite.getUnite(), world); - break;*/ + break;*//* } } System.out.println(); - } + }*/ }