Added some more frames for Blue.

Updated Action constructors.
This commit is contained in:
no 2021-06-10 10:06:44 +02:00
parent 10b3b60598
commit f56c84ef8e
7 changed files with 238 additions and 26 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-windows</lwjgl.natives> <lwjgl.natives>natives-linux</lwjgl.natives>
<javafx.version>11</javafx.version> <javafx.version>11</javafx.version>
</properties> </properties>

View File

@ -39,6 +39,11 @@ public class BlueBaseFrames {
return blueStandframe1; return blueStandframe1;
} }
protected static Frame[] blueStandFrames() {
Frame[] sf = {generateStandFrame1(),generateStandFrame2()};
return sf;
}
private static Frame generateCrouchFrame1(){ private static Frame generateCrouchFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
@ -49,10 +54,15 @@ 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(112,120,112,120);
return blueStandframe1; return blueStandframe1;
} }
protected static Frame[] blueCrouchFrames() {
Frame[] cF = {generateCrouchFrame1()};
return cF;
}
private static Frame generateNeutralJumpFrame1(){ private static Frame generateNeutralJumpFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
@ -81,6 +91,17 @@ public class BlueBaseFrames {
return blueStandframe1; return blueStandframe1;
} }
protected static Frame[] blueNeutralJump() {
Frame[] jF = new Frame[40];
for(int i = 0; i < jF.length/2; i++) {
jF[i] = generateNeutralJumpFrame1();
}
for(int i = jF.length/2; i < jF.length; i++) {
jF[i] = generateNeutralJumpFrame2();
}
return jF;
}
private static Frame GenerateForwardJumpFrame1(){ private static Frame GenerateForwardJumpFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
@ -109,6 +130,17 @@ public class BlueBaseFrames {
return blueStandframe1; return blueStandframe1;
} }
protected static Frame[] blueForwardJump() {
Frame[] jF = new Frame[40];
for(int i = 0; i < jF.length/2; i++) {
jF[i] = GenerateForwardJumpFrame1();
}
for(int i = jF.length/2; i < jF.length; i++) {
jF[i] = GenerateForwardJumpFrame2();
}
return jF;
}
private static Frame BackJumpFrame1(){ private static Frame BackJumpFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
@ -123,6 +155,17 @@ public class BlueBaseFrames {
return blueStandframe1; return blueStandframe1;
} }
protected static Frame[] blueBackJump() {
Frame[] jF = new Frame[40];
for(int i = 0; i < jF.length/2; i++) {
jF[i] = BackJumpFrame1();
}
for(int i = jF.length/2; i < jF.length; i++) {
jF[i] = BackJumpFrame2();
}
return jF;
}
private static Frame BackJumpFrame2(){ private static Frame BackJumpFrame2(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500); Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100); Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
@ -137,6 +180,138 @@ public class BlueBaseFrames {
return blueStandframe1; return blueStandframe1;
} }
private static Frame walkForwardFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(220,0,112,120);
return blueStandframe1;
}
private static Frame walkForwardFrame2(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(330,0,112,120);
return blueStandframe1;
}
private static Frame walkForwardFrame3(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(420,0,112,120);
return blueStandframe1;
}
private static Frame walkForwardFrame4(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(500,0,112,120);
return blueStandframe1;
}
protected static Frame[] blueFWalk() {
Frame[] f = new Frame[4];
f[0] = walkForwardFrame1();
f[1] = walkForwardFrame2();
f[2] = walkForwardFrame3();
f[3] = walkForwardFrame4();
return f;
}
private static Frame walkBackFrame4(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(220,0,112,120);
return blueStandframe1;
}
private static Frame walkBackFrame3(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(330,0,112,120);
return blueStandframe1;
}
private static Frame walkBackFrame2(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(420,0,112,120);
return blueStandframe1;
}
private static Frame walkBackFrame1(){
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,150,500);
Passive_throw_HitBox bStandPTHB1 = new Passive_throw_HitBox(70,400,150,100);
Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500);
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
phb.add(bStandPHB1);
pthb.add(bStandPTHB1);
Frame blueStandframe1 = new Frame(0.0,-8.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
bStandPB1,true,true,true,true,true);
blueStandframe1.setSpriteWrap(500,0,112,120);
return blueStandframe1;
}
protected static Frame[] blueBWalk() {
Frame[] f = new Frame[4];
f[0] = walkBackFrame1();
f[1] = walkBackFrame2();
f[2] = walkBackFrame3();
f[3] = walkBackFrame4();
return f;
}
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, new Vector3f(4.0f, 3.0f));
engine.init(); engine.init();

View File

@ -1,9 +1,22 @@
package gameplay.Characters.Blue; package gameplay.Characters.Blue;
import gameplay.actions.Jump;
import gameplay.entities.Character; import gameplay.entities.Character;
import gameplay.frames.Frame;
import gameplay.Characters.Blue.BlueBaseFrames;
import static gameplay.input.ButtonIG.*;
public class CharacterBlue { public class CharacterBlue {
public Character generateCharBlue(){ public static Character generateCharBlue(){
Frame[] standF = BlueBaseFrames.blueStandFrames();
Frame[] crouchF = BlueBaseFrames.blueCrouchFrames();
Frame[] nJumpF = BlueBaseFrames.blueNeutralJump();
Frame[] fJumpF = BlueBaseFrames.blueForwardJump();
Frame[] bJumpF = BlueBaseFrames.blueBackJump();
Frame[] fWalkF = BlueBaseFrames.blueFWalk();
Frame[] bWalkF = BlueBaseFrames.blueBWalk();
return new Character(); return new Character();
} }
} }

View File

@ -10,24 +10,31 @@ public class Attack implements Action {
/** /**
* Defines if the attack is a special one (E.G. a fireball) or a normal one (a punch) * Defines if the attack is a special one (E.G. a fireball) or a normal one (a punch)
*/ */
private static boolean isSpecial; private boolean isSpecial;
private Status requiredStatus;
private static Status requiredStatus;
/** /**
* The suite of Inputs to have the move come out. * The suite of Inputs to have the move come out.
* For example, a classic fireball would be something like * For example, a classic fireball would be something like
* {{DOWN},{DOWN,RIGHT},{RIGHT},{A}} * {{DOWN},{DOWN,RIGHT},{RIGHT},{A}}
*/ */
private static ButtonIG[][] command; private ButtonIG[][] command;
/** /**
* The different sections of the attack * The different sections of the attack
*/ */
private attackPart[] parts; private attackPart[] parts;
public Attack(boolean isSpecial, Status requiredStatus, ButtonIG[][] command, attackPart[] parts) {
this.isSpecial = isSpecial;
this.requiredStatus = requiredStatus;
this.command = command;
this.parts = parts;
}
@Override @Override
public ArrayList<Frame> getFrame() { public ArrayList<Frame> getFrame() {
ArrayList<Frame> res = new ArrayList<Frame>(); ArrayList<Frame> res = new ArrayList<Frame>();
@ -47,21 +54,21 @@ public class Attack implements Action {
return res; return res;
} }
public static boolean isIsSpecial() { public boolean isIsSpecial() {
return isSpecial; return this.isSpecial;
} }
public static void setIsSpecial(boolean isSpecial) { public void setIsSpecial(boolean isSpecial) {
Attack.isSpecial = isSpecial; this.isSpecial = isSpecial;
} }
@Override @Override
public ButtonIG[][] getCommand() { public ButtonIG[][] getCommand() {
return command; return this.command;
} }
public static void setCommand(ButtonIG[][] command) { public void setCommand(ButtonIG[][] command) {
Attack.command = command; this.command = command;
} }
public attackPart[] getParts() { public attackPart[] getParts() {
@ -72,13 +79,15 @@ public class Attack implements Action {
this.parts = parts; this.parts = parts;
} }
public static Status getRequiredStatus() { public Status getRequiredStatus() {
return requiredStatus; return this.requiredStatus;
} }
public static void setRequiredStatus(Status requiredStatus) { public void setRequiredStatus(Status requiredStatus) {
Attack.requiredStatus = requiredStatus; this.requiredStatus = requiredStatus;
} }
public boolean isSpecial() {return this.isSpecial();} public boolean isSpecial() {return this.isSpecial();}
} }

View File

@ -11,11 +11,11 @@ public class Dash implements Action {
* For example, a Front Dash would be something like * For example, a Front Dash would be something like
* {{FORWARD},{FORWARD}} * {{FORWARD},{FORWARD}}
*/ */
private static ButtonIG[][] command; private ButtonIG[][] command;
private Frame[] frames; private Frame[] frames;
@Override @Override
public ArrayList<Frame> getFrame() { public ArrayList<Frame> getFrame() {
ArrayList<Frame> res = new ArrayList<Frame>(); ArrayList<Frame> res = new ArrayList<Frame>();
@ -27,7 +27,11 @@ public class Dash implements Action {
@Override @Override
public ButtonIG[][] getCommand() { public ButtonIG[][] getCommand() {
return command; return this.command;
} }
public Dash(ButtonIG[][] command, Frame[] frames) {
this.command = command;
this.frames = frames;
}
} }

View File

@ -12,7 +12,7 @@ public class Jump implements Action {
* For example, a Front Jump would be something like * For example, a Front Jump would be something like
* {{UP,RIGHT}} * {{UP,RIGHT}}
*/ */
private static ButtonIG[][] command; private ButtonIG[][] command;
private Frame[] frames; private Frame[] frames;
@ -27,7 +27,11 @@ public class Jump implements Action {
@Override @Override
public ButtonIG[][] getCommand() { public ButtonIG[][] getCommand() {
return command; return this.command;
} }
public Jump(ButtonIG[][] command, Frame[] frames) {
this.command = command;
this.frames = frames;
}
} }

View File

@ -10,7 +10,7 @@ public class Throw implements Action {
/** /**
* Defines if the throw is a special one (E.G. a Moonsault Press ) or a normal one * Defines if the throw is a special one (E.G. a Moonsault Press ) or a normal one
*/ */
private static boolean isSpecial; private boolean isSpecial;
/** /**
* The suite of Inputs to have the move come out. * The suite of Inputs to have the move come out.
@ -52,7 +52,14 @@ public class Throw implements Action {
@Override @Override
public ButtonIG[][] getCommand() { public ButtonIG[][] getCommand() {
return command; return this.command;
} }
public Throw(boolean isSpecial, ThrowPart[] parts) {
this.isSpecial = isSpecial;
this.parts = parts;
}
public Throw() {
}
} }