diff --git a/src/main/java/fr/ynerant/leveleditor/game/GameFrame.java b/src/main/java/fr/ynerant/leveleditor/game/GameFrame.java index fc78c0d..1de9d2d 100644 --- a/src/main/java/fr/ynerant/leveleditor/game/GameFrame.java +++ b/src/main/java/fr/ynerant/leveleditor/game/GameFrame.java @@ -123,7 +123,7 @@ public class GameFrame extends JFrame { for (Tower tower : towers) { for (Mob mob : tower.filterDetectedMobs(mobs)) - mob.hit(); + mob.hit(tower.getDamagePerShot()); } for (Mob mob : new ArrayList<>(mobs)) { @@ -192,14 +192,6 @@ public class GameFrame extends JFrame { g.drawImage(s.getImage(), SPRITE_SIZE * tower.getX(), SPRITE_SIZE * tower.getY(), SPRITE_SIZE, SPRITE_SIZE, null, null); } - for (RawCase c : getMap().getCases()) { - if (c.getCollision() == Collision.ANY) - continue; - - g.setColor(new Color(0x10000000)); - g.fillRect(SPRITE_SIZE * c.getPosX(), SPRITE_SIZE * c.getPosY(), SPRITE_SIZE, SPRITE_SIZE); - } - repaint(); } diff --git a/src/main/java/fr/ynerant/leveleditor/game/Mob.java b/src/main/java/fr/ynerant/leveleditor/game/Mob.java index 34c810c..3b5e859 100644 --- a/src/main/java/fr/ynerant/leveleditor/game/Mob.java +++ b/src/main/java/fr/ynerant/leveleditor/game/Mob.java @@ -59,9 +59,9 @@ public abstract class Mob { this.hp = hp; } - public boolean hit() { + public boolean hit(int damage) { if (!isDead()) { - --this.hp; + this.hp -= damage; return true; }