This commit is contained in:
François Autin 2021-06-10 15:21:10 +02:00
commit bf9ba6010e
6 changed files with 20 additions and 12 deletions

View File

@ -34,7 +34,7 @@
<properties> <properties>
<lwjgl.version>3.2.3</lwjgl.version> <lwjgl.version>3.2.3</lwjgl.version>
<lwjgl.natives>natives-linux</lwjgl.natives> <lwjgl.natives>natives-windows</lwjgl.natives>
<javafx.version>11</javafx.version> <javafx.version>11</javafx.version>
</properties> </properties>

View File

@ -66,7 +66,7 @@ public class Engine {
*/ */
public void init() { public void init() {
if (!glfwInit()){ if (!glfwInit()){
System.exit(1); System.exit(-1);
} }
this.running = true; this.running = true;
@ -83,7 +83,7 @@ public class Engine {
assert getWindow() != NULL; assert getWindow() != NULL;
boolean present = glfwJoystickPresent(GLFW_JOYSTICK_1); 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 // On récupère les informations du moniteur principal
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());

View File

@ -35,7 +35,7 @@ public class BlueBaseFrames {
pthb.add(bStandPTHB1); pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(), Frame blueStandframe1 = new Frame(0.0,0.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true); bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(112,0,112,120); blueStandframe1.setSpriteWrap(0,0,112,120);
return blueStandframe1; return blueStandframe1;
} }

View File

@ -40,8 +40,15 @@ public class nextFrameBuffer {
} }
public void goToNext() { public void goToNext() {
this.current = this.next.current; try {
this.next = this.next.next; 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() { public Frame getCurrentFrame() {

View File

@ -112,7 +112,7 @@ public class InputBuffer {
} catch (ArrayIndexOutOfBoundsException e ) { } catch (ArrayIndexOutOfBoundsException e ) {
return true; return true;
} }
for(int i = command.length - 2; i <= 0 && ret; i--) { for(int i = command.length - 2; i >= 0 && ret; i--) {
backCounter = 1; backCounter = 1;
if(startFrameCount - backCounter < 0) {frameToCheck = this.size - (backCounter - startFrameCount);} if(startFrameCount - backCounter < 0) {frameToCheck = this.size - (backCounter - startFrameCount);}
else {frameToCheck = startFrameCount - backCounter;} else {frameToCheck = startFrameCount - backCounter;}
@ -122,7 +122,7 @@ public class InputBuffer {
ret = true; ret = true;
search = false; search = false;
} else { } else {
if(backCounter == pastFramesToCheck) { if(backCounter >= pastFramesToCheck) {
ret = false; ret = false;
search = false; search = false;
} }
@ -132,8 +132,9 @@ public class InputBuffer {
else {frameToCheck = startFrameCount - backCounter;} else {frameToCheck = startFrameCount - backCounter;}
} }
} }
startFrameCount = frameToCheck;
} }
startFrameCount = frameToCheck;
} }
return ret; return ret;

View File

@ -41,7 +41,7 @@ public class match {
/** /**
* the level of the "ground", used to determine if a character is in the air or not. * 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 int timer;
private static InputBuffer inputsP1, inputsP2; private static InputBuffer inputsP1, inputsP2;
@ -70,9 +70,9 @@ public class match {
inputsP1 = new InputBuffer(inputBufferSize); inputsP1 = new InputBuffer(inputBufferSize);
inputsP2 = new InputBuffer(inputBufferSize); inputsP2 = new InputBuffer(inputBufferSize);
p1.setPos(-750, groundLevel); //TODO : change to better values if needed 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(p1.getPosX(),p1.getPosY(),0));
objP1.translate(new Vector3f(p2.getPosX(),p2.getPosY(),0)); objP2.translate(new Vector3f(p2.getPosX(),p2.getPosY(),0));
} }
/** /**