diff --git a/src/gameplay/Characters/Blue/BlueSpecials.java b/src/gameplay/Characters/Blue/BlueSpecials.java index f5a0cac..73f6937 100644 --- a/src/gameplay/Characters/Blue/BlueSpecials.java +++ b/src/gameplay/Characters/Blue/BlueSpecials.java @@ -252,5 +252,4 @@ public class BlueSpecials { return new Attack(isSpecial,rS,cmd,parts); } - } diff --git a/src/gameplay/frames/Frame.java b/src/gameplay/frames/Frame.java index 2a11b0a..7a94eb9 100644 --- a/src/gameplay/frames/Frame.java +++ b/src/gameplay/frames/Frame.java @@ -25,6 +25,7 @@ public class Frame { private boolean moveCancellable; private boolean isDashCancellable; private boolean lastFrameOfHit; + /** * an int of 4 that determines the texture wrap for the frame */ @@ -176,11 +177,9 @@ public class Frame { public void clone(Frame f) { this.setMove_y(f.getMove_y()); this.setMove_x(f.getMove_x()); - this.setPassHitBox(f.getPassHitBox()); - this.setActHitBox(f.getActHitBox()); - this.setPassThrowHitBox(f.getPassThrowHitBox()); - this.setActThrowHitBox(f.getActThrowHitBox()); - this.setPushHitBox(f.getPushHitBox()); + this.cloneArray(f); //Il faut cloner individuellement chaque hitbox des differentes listes pour ne pas garder les pointeurs + Push_HitBox phb = f.getPushHitBox(); + this.setPushHitBox(new Push_HitBox(phb.getPosX(), phb.getPosY(), phb.getSize_x(), phb.getSize_y())); this.normalCancellable = f.isNormalCancellable(); this.specialCancellable = f.isSpecialCancellable(); this.jumpCancellable = f.jumpCancellable; @@ -190,6 +189,25 @@ public class Frame { this.setSpriteWrap(f.sprite[0], f.sprite[1], f.sprite[2], f.sprite[3]); } + private void cloneArray(Frame f){ + for (Passive_HitBox hb : f.getPassHitBox()){ + Passive_HitBox nhb = new Passive_HitBox(hb.getPosX(), hb.getPosY(), hb.getSize_x(), hb.getSize_y()); + this.passHitBox.add(nhb); + } + for (Passive_throw_HitBox hb : f.getPassThrowHitBox()){ + Passive_throw_HitBox nhb = new Passive_throw_HitBox(hb.getPosX(), hb.getPosY(), hb.getSize_x(), hb.getSize_y()); + this.passThrowHitBox.add(nhb); + } + for (Active_HitBox hb : f.getActHitBox()){ + Active_HitBox nhb = new Active_HitBox(hb.getPosX(), hb.getPosY(), hb.getSize_x(), hb.getSize_y()); + this.actHitBox.add(nhb); + } + for (Active_throw_Hitbox hb : f.getActThrowHitBox()){ + Active_throw_Hitbox nhb = new Active_throw_Hitbox(hb.getPosX(), hb.getPosY(), hb.getSize_x(), hb.getSize_y()); + this.actThrowHitBox.add(nhb); + } + } + /** * sets the coordinates on the spritesheet for the texture for that frame * @param x coordinate of the lef tside diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index c31527f..8c6f634 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -318,6 +318,7 @@ public class match { if(p2.getCurrentframe().islastFrameOfHit()) { p2.removeFirstAttackPart(); } + nextFrame(p1,inputsP1); nextFrame(p2,inputsP2); @@ -358,6 +359,7 @@ public class match { objP1.flipTextureWrapH(); } + // Debug Hitbox Management removeHitboxEngine(); if (showP1Hitbox){