Implemented functions for knockedDown in BlueBaseFrames

This commit is contained in:
Rémi Rativel 2021-06-23 17:07:33 +02:00
parent a9ef37eeaf
commit 375230466d
2 changed files with 265 additions and 2 deletions

View File

@ -746,6 +746,267 @@ public class BlueBaseFrames {
return f;
}
private static Frame KnockedDown1() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap(0,(138*6),138,138);
return f;
}
private static Frame KnockedDown2() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap(138,(138*6),138,138);
return f;
}
private static Frame KnockedDown3() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*2),(138*6),138,138);
return f;
}
private static Frame KnockedDown4() {
//movement data
double moveX = 0.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*3),(138*6),138,138);
return f;
}
private static Frame KnockedDown5() {
//movement data
double moveX = 0.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*4),(138*6),138,138);
return f;
}
private static Frame KnockedDown6() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*5),(138*6),138,138);
return f;
}
private static Frame KnockedDown7() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*6),(138*6),138,138);
return f;
}
private static Frame KnockedDown8() {
//movement data
double moveX = -6.0;
double moveY = 0.0;
//cancelData
boolean normalC = false;
boolean specialC = false;
boolean jumpC = false;
boolean moveC = false;
boolean dashC = false;
//hitbox lists
ArrayList<Active_HitBox> ahb = new ArrayList<Active_HitBox>();
ArrayList<Active_throw_Hitbox> athb = new ArrayList<Active_throw_Hitbox>();
ArrayList<Passive_HitBox> phb = new ArrayList<Passive_HitBox>();
ArrayList<Passive_throw_HitBox> pthb = new ArrayList<Passive_throw_HitBox>();
//generate hitboxes here and then use ArrayList add method to add them to the correct list
Push_HitBox pB1 = new Push_HitBox(200,-150,160,400);
Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC);
//set sprite data on sheet
f.setSpriteWrap((138*7),(138*6),138,138);
return f;
}
protected static Frame[] knockedDown() {
Frame[] f = new Frame[50];
int i=0;
while(i < 5) {
f[i] = KnockedDown1();
i++;
}
while(i < 10) {
f[i] = KnockedDown2();
i++;
}
while(i < 15) {
f[i] = KnockedDown3();
i++;
}
while(i < 30) {
f[i] = KnockedDown4();
i++;
}
while(i < 35) {
f[i] = KnockedDown5();
i++;
}
while(i < 40) {
f[i] = KnockedDown6();
i++;
}
while(i < 45) {
f[i] = KnockedDown7();
i++;
}
while(i < f.length) {
f[i] = KnockedDown8();
i++;
}
return f;
}
public static void main(String[] args) {
Engine engine = new Engine(640, 480, new Vector3f(4.0f, 3.0f));

View File

@ -58,11 +58,13 @@ public class CharacterBlue {
Frame[] fallingFs = new Frame[0];
Frame[] knDwn = BlueBaseFrames.knockedDown();
Frame f = new Frame();
Character c = new Character(0,0,standF[0],1000,atks,fJ,nJ,bJ,fDash,bDash,th,standF,crouchF,fWalkF,bWalkF,f,f,fallingFs,sbf,cbf,shf,chf);
Character c = new Character(0,0,standF[0],1000,atks,fJ,nJ,bJ,fDash,bDash,th,standF,crouchF,fWalkF,bWalkF,f,f,knDwn,sbf,cbf,shf,chf);
return c;
}