Skip to content
Snippets Groups Projects
Commit a944dd92 authored by timeo's avatar timeo
Browse files

plateformes se génèrent

parent affd31a5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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();
}
}*/
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment