Changed hit function to be coherent with the attribut pushHitBox in

Frame
This commit is contained in:
keizaal 2021-05-27 15:54:26 +02:00
parent e52f8e890e
commit 43146a3aab
2 changed files with 7 additions and 6 deletions

View File

@ -15,6 +15,7 @@ public class Frame {
private ArrayList<Active_HitBox> actHitBox; private ArrayList<Active_HitBox> actHitBox;
private ArrayList<Passive_throw_HitBox> passThrowHitBox; private ArrayList<Passive_throw_HitBox> passThrowHitBox;
private ArrayList<Active_throw_Hitbox> actThrowHitBox; private ArrayList<Active_throw_Hitbox> actThrowHitBox;
private Push_HitBox pushHitBox;
public Frame() { public Frame() {

View File

@ -70,12 +70,12 @@ public class HitBox {
/* /*
* HitBox overlap horizontally * HitBox overlap horizontally
*/ */
if(this.position_x <= hb.position_x) { //this is at left of hb if(this.position_x < hb.position_x) { //this is at left of hb
if(hb.position_x <= horizontal1) { if(hb.position_x < horizontal1) {
horiz = true; horiz = true;
} }
}else {//this is at left of hb }else {//this is at left of hb
if(this.position_x <= horizontal2) { if(this.position_x < horizontal2) {
horiz = true; horiz = true;
} }
} }
@ -83,12 +83,12 @@ public class HitBox {
/* /*
* HitBox overlap vertically * HitBox overlap vertically
*/ */
if(this.position_y <= hb.position_y) { //this is at top of hb if(this.position_y < hb.position_y) { //this is at top of hb
if(hb.position_y <= vertical1) { if(hb.position_y < vertical1) {
ver = true; ver = true;
} }
}else {//this is at left of hb }else {//this is at left of hb
if(this.position_x <= vertical2) { if(this.position_x < vertical2) {
ver = true; ver = true;
} }
} }