- 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:
no
2021-06-10 02:38:47 +02:00
parent 1f0a14bb23
commit 10b3b60598
10 changed files with 270 additions and 28 deletions

View File

@ -2,6 +2,7 @@ package gameplay.frames;
import java.util.ArrayList;
import engine.graphics.Texture;
import gameplay.hitboxes.*;
/**
@ -24,6 +25,10 @@ public class Frame {
private boolean moveCancellable;
private boolean isDashCancellable;
private boolean lastFrameOfHit;
/**
* an int of 4 that determines the texture wrap for the frame
*/
private int[] sprite;
public Frame() {
this.setMove_y(0.0);
@ -39,6 +44,7 @@ public class Frame {
this.moveCancellable = true;
this.isDashCancellable = true;
this.lastFrameOfHit = false;
this.sprite = new int[0];
}
public Frame(Double move_y, Double move_x, ArrayList<Passive_HitBox> passHitBox, ArrayList<Active_HitBox> actHitBox,
@ -58,6 +64,7 @@ public class Frame {
this.moveCancellable = moveCancellable;
this.isDashCancellable = isDashCancellable;
this.lastFrameOfHit = false;
this.sprite = new int[4];
}
/*
@ -179,6 +186,25 @@ public class Frame {
this.jumpCancellable = f.jumpCancellable;
this.moveCancellable = f.isMoveCancellable();
this.isDashCancellable = f.isDashCancellable;
this.lastFrameOfHit = islastFrameOfHit();
this.lastFrameOfHit = f.islastFrameOfHit();
this.setSpriteWrap(f.sprite[0], f.sprite[1], f.sprite[2], f.sprite[3]);
}
/**
* sets the coordinates on the spritesheet for the texture for that frame
* @param x coordinate of the lef tside
* @param y coordonate of the top
* @param sizeH horizontal size of the sprite
* @param sizeV horizontal size of the sprite
*/
public void setSpriteWrap(int x, int y, int sizeH, int sizeV) {
this.sprite[0] = x;
this.sprite[1] = y;
this.sprite[2] = sizeH;
this.sprite[3] = sizeV;
}
public int[] getSprite() {
return sprite;
}
}