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>
<lwjgl.version>3.2.3</lwjgl.version>
<lwjgl.natives>natives-linux</lwjgl.natives>
<lwjgl.natives>natives-windows</lwjgl.natives>
<javafx.version>11</javafx.version>
</properties>

View File

@ -66,7 +66,7 @@ public class Engine {
*/
public void init() {
if (!glfwInit()){
System.exit(1);
System.exit(-1);
}
this.running = true;

View File

@ -35,7 +35,7 @@ public class BlueBaseFrames {
pthb.add(bStandPTHB1);
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);
blueStandframe1.setSpriteWrap(112,0,112,120);
blueStandframe1.setSpriteWrap(0,0,112,120);
return blueStandframe1;
}

View File

@ -40,8 +40,15 @@ public class nextFrameBuffer {
}
public void goToNext() {
try {
nextFrameBuffer nfb = new nextFrameBuffer();
nfb.clone(this.next);
this.current = this.next.current;
this.next = this.next.next;
this.next.clone(nfb);
} catch (NullPointerException n) {
this.setCurrentFrame(null);
this.setNext(new nextFrameBuffer());
}
}
public Frame getCurrentFrame() {

View File

@ -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;

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.
*/
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));
}
/**