Merge branch 'master' of https://gitlab.istic.univ-rennes1.fr/fautin/jeu-de-combat.git
This commit is contained in:
commit
30b227d883
@ -28,6 +28,7 @@ public class Engine {
|
|||||||
|
|
||||||
private final int width;
|
private final int width;
|
||||||
private final int height;
|
private final int height;
|
||||||
|
private final boolean fullscreen;
|
||||||
|
|
||||||
private float viewXPos;
|
private float viewXPos;
|
||||||
private float viewYPos;
|
private float viewYPos;
|
||||||
@ -45,7 +46,7 @@ public class Engine {
|
|||||||
* Initial projection is -1000;1000 in width and -1000*aspectRatio; 1000*aspectRatio
|
* Initial projection is -1000;1000 in width and -1000*aspectRatio; 1000*aspectRatio
|
||||||
* Initial Camera position is (0, 0, -1) //TODO vérifiez
|
* Initial Camera position is (0, 0, -1) //TODO vérifiez
|
||||||
*/
|
*/
|
||||||
public Engine(int width, int height, Vector3f aspectRatio) {
|
public Engine(int width, int height, boolean fullscreen, Vector3f aspectRatio) {
|
||||||
this.running = false;
|
this.running = false;
|
||||||
this.objectsGl = new ArrayList<>();
|
this.objectsGl = new ArrayList<>();
|
||||||
this.uiElements = new ArrayList<>();
|
this.uiElements = new ArrayList<>();
|
||||||
@ -57,6 +58,7 @@ public class Engine {
|
|||||||
ObjectGl.view = Matrix4f.translate(new Vector3f(0.0f, 0.0f, 1.0f));
|
ObjectGl.view = Matrix4f.translate(new Vector3f(0.0f, 0.0f, 1.0f));
|
||||||
this.transformationView = new Vector3f();
|
this.transformationView = new Vector3f();
|
||||||
this.tracking = null;
|
this.tracking = null;
|
||||||
|
this.fullscreen = fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,7 +81,11 @@ public class Engine {
|
|||||||
|
|
||||||
int width = this.width;
|
int width = this.width;
|
||||||
int height = this.height;
|
int height = this.height;
|
||||||
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", NULL, NULL));
|
if (fullscreen) {
|
||||||
|
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", glfwGetPrimaryMonitor(), NULL));
|
||||||
|
} else {
|
||||||
|
this.setWindow(glfwCreateWindow(width, height, "Boulevard Combattant", NULL, NULL));
|
||||||
|
}
|
||||||
assert getWindow() != NULL;
|
assert getWindow() != NULL;
|
||||||
|
|
||||||
// On récupère les informations du moniteur principal
|
// On récupère les informations du moniteur principal
|
||||||
|
@ -36,7 +36,7 @@ public class TestEngine {
|
|||||||
/*
|
/*
|
||||||
Engine Init
|
Engine Init
|
||||||
*/
|
*/
|
||||||
Engine engine = new Engine(1280, 720, new Vector3f(4.0f, 3.0f));
|
Engine engine = new Engine(1280, 720, false, new Vector3f(4.0f, 3.0f));
|
||||||
int speed = 10; //vitesse d<EFBFBD>placement Object
|
int speed = 10; //vitesse d<EFBFBD>placement Object
|
||||||
engine.init();
|
engine.init();
|
||||||
|
|
||||||
|
@ -1009,7 +1009,7 @@ public class BlueBaseFrames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Engine engine = new Engine(640, 480, new Vector3f(4.0f, 3.0f));
|
Engine engine = new Engine(640, 480, false, new Vector3f(4.0f, 3.0f));
|
||||||
engine.init();
|
engine.init();
|
||||||
|
|
||||||
Vector3f BLUE = new Vector3f(0f,0f,1f); //passive_hit
|
Vector3f BLUE = new Vector3f(0f,0f,1f); //passive_hit
|
||||||
|
@ -94,8 +94,13 @@ public class match {
|
|||||||
private static Engine engine;
|
private static Engine engine;
|
||||||
private static Frame f;
|
private static Frame f;
|
||||||
private static int acCode = 0;
|
private static int acCode = 0;
|
||||||
private static int height, width;
|
private static boolean roundP1=false;
|
||||||
private static boolean roundP1=false ;
|
|
||||||
|
// Settings
|
||||||
|
private static int height, width, rounds;
|
||||||
|
private static String character1, character2, stage;
|
||||||
|
private static boolean fullscreen;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a new round, by placing the timer back at base value, characters back at full hp and such.
|
* Starts a new round, by placing the timer back at base value, characters back at full hp and such.
|
||||||
@ -154,6 +159,11 @@ public class match {
|
|||||||
|
|
||||||
height = Integer.parseInt((String) settings.get("height"));
|
height = Integer.parseInt((String) settings.get("height"));
|
||||||
width = Integer.parseInt((String) settings.get("width"));
|
width = Integer.parseInt((String) settings.get("width"));
|
||||||
|
fullscreen = Boolean.parseBoolean((String) settings.get("fullscreen"));
|
||||||
|
rounds = Integer.parseInt((String) settings.get("rounds"));
|
||||||
|
character1 = (String) settings.get("character1");
|
||||||
|
character2 = (String) settings.get("character2");
|
||||||
|
stage = (String) settings.get("stage");
|
||||||
} catch (ParseException | IOException e) {
|
} catch (ParseException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -161,24 +171,53 @@ public class match {
|
|||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
parse();
|
parse();
|
||||||
engine = new Engine(width, height, new Vector3f(4.0f, 3.0f));
|
engine = new Engine(width, height, fullscreen, new Vector3f(4.0f, 3.0f));
|
||||||
engine.init();
|
engine.init();
|
||||||
|
|
||||||
boolean Joystick1Present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
boolean Joystick1Present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
||||||
boolean Joystick2Present = glfwJoystickPresent(GLFW_JOYSTICK_2);
|
boolean Joystick2Present = glfwJoystickPresent(GLFW_JOYSTICK_2);
|
||||||
|
|
||||||
String path = "textures/Sprite_sans_grille_9comp.png";
|
String pathToBG = "";
|
||||||
String pathToBG = "textures/arena1.png";
|
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);
|
ObjectGl background = new ObjectGl(0f,1f,1f,2.5f, pathToBG, null);
|
||||||
background.setTextureWrap(0, 0, 1914f, 701f);
|
background.setTextureWrap(0, 0, 1914f, 701f);
|
||||||
background.translate(new Vector3f(-1350f, 1000f, 0f));
|
background.translate(new Vector3f(-1350f, 1000f, 0f));
|
||||||
engine.add_objectGl(background);
|
engine.add_objectGl(background);
|
||||||
|
|
||||||
p1 = CharacterBlue.generateCharBlue();
|
String pathp1 = "";
|
||||||
p2 = CharacterBlue.generateCharBlue();
|
String pathp2 = "";
|
||||||
objP1 = new Sprite(14f, 5f, path, null);
|
|
||||||
objP2 = new Sprite(15f, 5f, path, new Vector3f(1.0f,0.0f,1.0f));
|
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(objP1);
|
||||||
engine.add_objectGl(objP2);
|
engine.add_objectGl(objP2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user