Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/gameplay/Characters/Blue/BlueNormals.java
This commit is contained in:
no 2021-06-20 17:57:35 +02:00
commit ebf4c198ad
3 changed files with 25 additions and 6 deletions

View File

@ -252,5 +252,4 @@ public class BlueSpecials {
return new Attack(isSpecial,rS,cmd,parts); return new Attack(isSpecial,rS,cmd,parts);
} }
} }

View File

@ -25,6 +25,7 @@ public class Frame {
private boolean moveCancellable; private boolean moveCancellable;
private boolean isDashCancellable; private boolean isDashCancellable;
private boolean lastFrameOfHit; private boolean lastFrameOfHit;
/** /**
* an int of 4 that determines the texture wrap for the frame * an int of 4 that determines the texture wrap for the frame
*/ */
@ -176,11 +177,9 @@ public class Frame {
public void clone(Frame f) { public void clone(Frame f) {
this.setMove_y(f.getMove_y()); this.setMove_y(f.getMove_y());
this.setMove_x(f.getMove_x()); this.setMove_x(f.getMove_x());
this.setPassHitBox(f.getPassHitBox()); this.cloneArray(f); //Il faut cloner individuellement chaque hitbox des differentes listes pour ne pas garder les pointeurs
this.setActHitBox(f.getActHitBox()); Push_HitBox phb = f.getPushHitBox();
this.setPassThrowHitBox(f.getPassThrowHitBox()); this.setPushHitBox(new Push_HitBox(phb.getPosX(), phb.getPosY(), phb.getSize_x(), phb.getSize_y()));
this.setActThrowHitBox(f.getActThrowHitBox());
this.setPushHitBox(f.getPushHitBox());
this.normalCancellable = f.isNormalCancellable(); this.normalCancellable = f.isNormalCancellable();
this.specialCancellable = f.isSpecialCancellable(); this.specialCancellable = f.isSpecialCancellable();
this.jumpCancellable = f.jumpCancellable; 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]); 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 * sets the coordinates on the spritesheet for the texture for that frame
* @param x coordinate of the lef tside * @param x coordinate of the lef tside

View File

@ -318,6 +318,7 @@ public class match {
if(p2.getCurrentframe().islastFrameOfHit()) { if(p2.getCurrentframe().islastFrameOfHit()) {
p2.removeFirstAttackPart(); p2.removeFirstAttackPart();
} }
nextFrame(p1,inputsP1); nextFrame(p1,inputsP1);
nextFrame(p2,inputsP2); nextFrame(p2,inputsP2);
@ -358,6 +359,7 @@ public class match {
objP1.flipTextureWrapH(); objP1.flipTextureWrapH();
} }
// Debug Hitbox Management // Debug Hitbox Management
removeHitboxEngine(); removeHitboxEngine();
if (showP1Hitbox){ if (showP1Hitbox){