Added stage selection capabilities

This commit is contained in:
François Autin 2021-06-23 16:52:00 +02:00
parent 058ee337ca
commit e645f66dc8

View File

@ -177,18 +177,47 @@ public class match {
boolean Joystick1Present = glfwJoystickPresent(GLFW_JOYSTICK_1);
boolean Joystick2Present = glfwJoystickPresent(GLFW_JOYSTICK_2);
String path = "textures/Sprite_sans_grille_9comp.png";
String pathToBG = "textures/arena1.png";
String pathToBG = "";
switch (stage) {
case "arena1":
pathToBG = "textures/arena1.png";
break;
default:
pathToBG = "textures/arena1.png";
}
ObjectGl background = new ObjectGl(0f,1f,1f,2.5f, pathToBG, null);
background.setTextureWrap(0, 0, 1914f, 701f);
background.translate(new Vector3f(-1350f, 1000f, 0f));
engine.add_objectGl(background);
p1 = CharacterBlue.generateCharBlue();
p2 = CharacterBlue.generateCharBlue();
objP1 = new Sprite(14f, 5f, path, null);
objP2 = new Sprite(15f, 5f, path, new Vector3f(1.0f,0.0f,1.0f));
String pathp1 = "";
String pathp2 = "";
switch (character1) {
case "blue":
p1 = CharacterBlue.generateCharBlue();
pathp1 = "textures/Sprite_sans_grille_9comp.png";
break;
default:
p1 = CharacterBlue.generateCharBlue();
pathp1 = "textures/Sprite_sans_grille_9comp.png";
break;
}
switch (character2) {
case "blue":
p2 = CharacterBlue.generateCharBlue();
pathp2 = "textures/Sprite_sans_grille_9comp.png";
break;
default:
p2 = CharacterBlue.generateCharBlue();
pathp2 = "textures/Sprite_sans_grille_9comp.png";
break;
}
objP1 = new Sprite(14f, 5f, pathp1, null);
objP2 = new Sprite(15f, 5f, pathp2, new Vector3f(1.0f,0.0f,1.0f));
engine.add_objectGl(objP1);
engine.add_objectGl(objP2);