- added some of the first frames (though still incomplete themselves) for the first character.
- changed pos and size data for hitboxes from double to float
This commit is contained in:
176
src/gameplay/Characters/Blue/BlueBaseFrames.java
Normal file
176
src/gameplay/Characters/Blue/BlueBaseFrames.java
Normal file
@ -0,0 +1,176 @@
|
||||
package gameplay.Characters.Blue;
|
||||
|
||||
import engine.Engine;
|
||||
import engine.math.Vector3f;
|
||||
import engine.object.Hitbox;
|
||||
import engine.object.ObjectGl;
|
||||
import gameplay.frames.Frame;
|
||||
import gameplay.hitboxes.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class BlueBaseFrames {
|
||||
|
||||
private static Frame generateStandFrame1(){
|
||||
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,0.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,true,true,true,true,true);
|
||||
blueStandframe1.setSpriteWrap(0,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame generateStandFrame2(){
|
||||
Passive_HitBox bStandPHB1 = new Passive_HitBox(70,70,75,300);
|
||||
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,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);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame generateCrouchFrame1(){
|
||||
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,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);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame generateNeutralJumpFrame1(){
|
||||
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(-10.0,0.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(830,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame generateNeutralJumpFrame2(){
|
||||
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(10.0,0.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(830,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame GenerateForwardJumpFrame1(){
|
||||
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(-10.0,10.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(750,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame GenerateForwardJumpFrame2(){
|
||||
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(10.0,10.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(750,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame BackJumpFrame1(){
|
||||
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(-10.0,-10.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(750,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
private static Frame BackJumpFrame2(){
|
||||
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(10.0,-10.0,phb,new ArrayList<Active_HitBox>(),pthb,new ArrayList<Active_throw_Hitbox>(),
|
||||
bStandPB1,false,false,false,false,false);
|
||||
blueStandframe1.setSpriteWrap(750,0,112,120);
|
||||
return blueStandframe1;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Engine engine = new Engine(640, 480, new Vector3f(4.0f, 3.0f));
|
||||
engine.init();
|
||||
|
||||
String path = "textures/Sprite.png";
|
||||
|
||||
Frame f = generateStandFrame1();
|
||||
ObjectGl blue = new ObjectGl(0f, 60f, 80f, 5f, path, null);
|
||||
blue.setTextureWrap(f.getSprite()[0], f.getSprite()[1], f.getSprite()[2], f.getSprite()[3], ObjectGl.STICK_TOP);
|
||||
blue.translate(new Vector3f(-750,200,0));
|
||||
int posX = -750;
|
||||
int posY = 200;
|
||||
engine.add_objectGl(blue);
|
||||
int counter = 0;
|
||||
long ts1, ts2;
|
||||
float posZ = 11;
|
||||
while(counter < 1000) {
|
||||
ts1 = System.currentTimeMillis();
|
||||
posZ = 11;
|
||||
engine.update();
|
||||
engine.render();
|
||||
counter++;
|
||||
for(Passive_HitBox h: f.getPassHitBox()){
|
||||
Hitbox hh = new Hitbox(posZ,h.getSize_x(),h.getSize_y(),5f,new Vector3f(1,0,0));
|
||||
engine.add_objectGl(hh);
|
||||
hh.translate(new Vector3f(-750+h.getPosY(),200+h.getPosY()));
|
||||
}
|
||||
blue.translate(new Vector3f(0,0,0));
|
||||
ts2 = System.currentTimeMillis();
|
||||
while(ts2-ts1 < 1000/20) {
|
||||
ts2 = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
9
src/gameplay/Characters/Blue/CharacterBlue.java
Normal file
9
src/gameplay/Characters/Blue/CharacterBlue.java
Normal file
@ -0,0 +1,9 @@
|
||||
package gameplay.Characters.Blue;
|
||||
|
||||
import gameplay.entities.Character;
|
||||
|
||||
public class CharacterBlue {
|
||||
public Character generateCharBlue(){
|
||||
return new Character();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user