diff --git a/Military-Hero-Core/src/com/annimon/militaryhero/Enemy.java b/Military-Hero-Core/src/com/annimon/militaryhero/Enemy.java index 52664f3..5178c84 100644 --- a/Military-Hero-Core/src/com/annimon/militaryhero/Enemy.java +++ b/Military-Hero-Core/src/com/annimon/militaryhero/Enemy.java @@ -13,24 +13,28 @@ public class Enemy { private static final int enemyHeight = enemy.getHeight(); private final int x, y; - private boolean isVisible; + private boolean visible; public Enemy(int x, int y) { this.x = x; this.y = y; - isVisible = true; + visible = true; + } + + public boolean isVisible() { + return visible; } public boolean isCollide(int sx, int sy) { if (inRange(sx, x, x + enemyWidth) && inRange(sy, y, y + enemyHeight)) { - isVisible = false; + visible = false; return true; } return false; } public void draw(Graphics g) { - if (isVisible) { + if (visible) { g.drawImage(enemy, x, y); } }