diff --git a/pom.xml b/pom.xml index 6a80a64..5593d30 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ 3.2.3 - natives-linux + natives-windows 11 diff --git a/src/engine/Engine.java b/src/engine/Engine.java index 8b84449..2f4be33 100644 --- a/src/engine/Engine.java +++ b/src/engine/Engine.java @@ -66,7 +66,7 @@ public class Engine { */ public void init() { if (!glfwInit()){ - System.exit(1); + System.exit(-1); } this.running = true; @@ -83,7 +83,7 @@ public class Engine { assert getWindow() != NULL; boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1); - System.out.println("Manette détectée : " + present); + System.out.println("Manette détectée: " + present); // On récupère les informations du moniteur principal GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); diff --git a/src/gameplay/Characters/Blue/BlueBaseFrames.java b/src/gameplay/Characters/Blue/BlueBaseFrames.java index 284e4ca..d8ebe93 100644 --- a/src/gameplay/Characters/Blue/BlueBaseFrames.java +++ b/src/gameplay/Characters/Blue/BlueBaseFrames.java @@ -35,7 +35,7 @@ public class BlueBaseFrames { pthb.add(bStandPTHB1); Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList(),pthb,new ArrayList(), bStandPB1,true,true,true,true,true); - blueStandframe1.setSpriteWrap(112,0,112,120); + blueStandframe1.setSpriteWrap(0,0,112,120); return blueStandframe1; } diff --git a/src/gameplay/frames/nextFrameBuffer.java b/src/gameplay/frames/nextFrameBuffer.java index 49c3b06..044174c 100644 --- a/src/gameplay/frames/nextFrameBuffer.java +++ b/src/gameplay/frames/nextFrameBuffer.java @@ -40,8 +40,15 @@ public class nextFrameBuffer { } public void goToNext() { - this.current = this.next.current; - this.next = this.next.next; + try { + nextFrameBuffer nfb = new nextFrameBuffer(); + nfb.clone(this.next); + this.current = this.next.current; + this.next.clone(nfb); + } catch (NullPointerException n) { + this.setCurrentFrame(null); + this.setNext(new nextFrameBuffer()); + } } public Frame getCurrentFrame() { diff --git a/src/gameplay/input/InputBuffer.java b/src/gameplay/input/InputBuffer.java index c7323c8..097cb4d 100644 --- a/src/gameplay/input/InputBuffer.java +++ b/src/gameplay/input/InputBuffer.java @@ -112,7 +112,7 @@ public class InputBuffer { } catch (ArrayIndexOutOfBoundsException e ) { return true; } - for(int i = command.length - 2; i <= 0 && ret; i--) { + for(int i = command.length - 2; i >= 0 && ret; i--) { backCounter = 1; if(startFrameCount - backCounter < 0) {frameToCheck = this.size - (backCounter - startFrameCount);} else {frameToCheck = startFrameCount - backCounter;} @@ -122,7 +122,7 @@ public class InputBuffer { ret = true; search = false; } else { - if(backCounter == pastFramesToCheck) { + if(backCounter >= pastFramesToCheck) { ret = false; search = false; } @@ -132,8 +132,9 @@ public class InputBuffer { else {frameToCheck = startFrameCount - backCounter;} } } - startFrameCount = frameToCheck; + } + startFrameCount = frameToCheck; } return ret; diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index c39516c..cc4535e 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -41,7 +41,7 @@ public class match { /** * the level of the "ground", used to determine if a character is in the air or not. */ - private static final int groundLevel = 200; + private static final int groundLevel = -400; private static int timer; private static InputBuffer inputsP1, inputsP2; @@ -70,9 +70,9 @@ public class match { inputsP1 = new InputBuffer(inputBufferSize); inputsP2 = new InputBuffer(inputBufferSize); p1.setPos(-750, groundLevel); //TODO : change to better values if needed - p2.setPos(-750, groundLevel); //TODO : change to better values if needed + p2.setPos((int) (750 - objP2.getWidth() * objP2.getScalingFactor()), groundLevel); //TODO : change to better values if needed objP1.translate(new Vector3f(p1.getPosX(),p1.getPosY(),0)); - objP1.translate(new Vector3f(p2.getPosX(),p2.getPosY(),0)); + objP2.translate(new Vector3f(p2.getPosX(),p2.getPosY(),0)); } /**