diff --git a/.gitignore b/.gitignore index a5cac0f..049b9a7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /bin/ /.idea/ /.project +/jeu-de-combat.iml diff --git a/src/gameplay/actions/Attack.java b/src/gameplay/actions/Attack.java index 48e9fe5..ba72498 100644 --- a/src/gameplay/actions/Attack.java +++ b/src/gameplay/actions/Attack.java @@ -14,5 +14,9 @@ public class Attack { * {{DOWN},{DOWN,RIGHT},{RIGHT},{A}} */ private static Button[][] command; - + + /** + * The different sections of the attack + */ + private attackPart[] parts; } diff --git a/src/gameplay/actions/attackPart.java b/src/gameplay/actions/attackPart.java new file mode 100644 index 0000000..9310f6f --- /dev/null +++ b/src/gameplay/actions/attackPart.java @@ -0,0 +1,114 @@ +package gameplay.actions; + +import gameplay.frames.Frame; + +/** + * This class represent one section (generally one isolated hit) of an attack. + */ +public class attackPart { + private int damage, chipDamage, hitstun, blockstun; + private double knockbackOnHit, knockbackOnBlock; + private Frame[] frames; + private boolean hasHit; + + /** + * Constructor with most parameters for an attack part, generally a hit + * @param damage the damage dealt to the enemy if the attack part connects + * @param chipDamage the damage dealt to the enemy if the attack part is blocked + * @param hitstun the amount of frames where the enemy is in hitstun if the attack part connects + * @param blockstun the amount of frames where the enemy is in blockstun if the attack part is blocked + * @param knockbackOnHit the distance the enemy gets moved back if hit + * @param knockbackOnBlock the distance the enemy gets moved back if blocked + * @param frames the array of frames for the part + */ + public attackPart(int damage, int chipDamage, int hitstun, int blockstun, double knockbackOnHit, double knockbackOnBlock, Frame[] frames) { + this.damage = damage; + this.chipDamage = chipDamage; + this.hitstun = hitstun; + this.blockstun = blockstun; + this.knockbackOnHit = knockbackOnHit; + this.knockbackOnHit = knockbackOnBlock; + this.frames = frames; + this.hasHit = false; + } + + /** + * Constructor for an attack part with only a frames array as parameter. + * Generally for a move startup or recovery. + * @param frames the array of frames for the part + */ + public attackPart(Frame[] frames) { + this.frames = frames; + this.damage = 0; + this.chipDamage = 0; + this.hitstun = 0; + this.blockstun = 0; + this.knockbackOnHit = 0.0; + this.knockbackOnBlock = 0.0; + this.hasHit = false; + } + + public boolean hasHit() { + return hasHit; + } + + public void setHasHit(boolean hasHit) { + this.hasHit = hasHit; + } + + public int getDamage() { + return this.damage; + } + + public void setDamage(int damage) { + this.damage = damage; + } + + public int getChipDamage() { + return this.chipDamage; + } + + public void setChipDamage(int chipDamage) { + this.chipDamage = chipDamage; + } + + public int getHitstun() { + return hitstun; + } + + public void setHitstun(int hitstun) { + this.hitstun = hitstun; + } + + public int getBlockstun() { + return blockstun; + } + + public void setBlockstun(int blockstun) { + this.blockstun = blockstun; + } + + public double getKnockbackOnHit() { + return knockbackOnHit; + } + + public void setKnockbackOnHit(double knockback) { + this.knockbackOnHit = knockback; + } + + public Frame[] getFrames() { + return frames; + } + + public void setFrames(Frame[] frames) { + this.frames = frames; + } + + public double getKnockbackOnBlock() { + return knockbackOnBlock; + } + + public void setKnockbackOnBlock(double knockbackOnBlock) { + this.knockbackOnBlock = knockbackOnBlock; + } +} diff --git a/src/gameplay/match/match.java b/src/gameplay/match/match.java index 6f54f84..513bf2a 100644 --- a/src/gameplay/match/match.java +++ b/src/gameplay/match/match.java @@ -3,6 +3,7 @@ package gameplay.match; import gameplay.input.InputBuffer; import gameplay.entities.*; import gameplay.entities.Character; +import engine.Engine; /** * Main class that describes the base structure of the match, with characters, timer and such @@ -37,6 +38,19 @@ public class match { this.roundsWonP1 = 0; this.roundsWonP2 = 0; } + + + /** + * Main function of a match. Contains the main gameplay loop. + * @param args arguments + */ + public static void main(String args[]) { + Character p1 = new Character(); //TODO : change to not a blank + Character p2 = new Character(); //TODO : same as above + match match = new match(p1,p2); + + + } }