diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/Image.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Bg.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/UnitDock.java | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Image.java b/core/src/ch/asynk/tankontank/engine/gfx/Image.java index 64063a6..1386679 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/Image.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/Image.java @@ -36,7 +36,7 @@ public class Image extends Sprite implements Drawable, Disposable if (texture != null) texture.dispose(); } - public boolean contains(float x, float y) + public boolean hit(float x, float y) { if (!visible) return false; return ((x >= getX()) && (y >= getY()) && (x <= (getX() + getWidth())) && (y <= (getY() + getHeight()))); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 2a72ea1..62a184e 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -213,10 +213,10 @@ public class Hud implements Disposable public boolean touchDown(float x, float y) { - if (reinforcement.contains(x,y) || unitDock.contains(x, y)) return true; + if (reinforcement.hit(x,y) || unitDock.hit(x, y)) return true; else unitDock.hide(); - if (turns.contains(x,y)) return true; - if (!actionsBg.contains(x,y)) return false; + if (turns.hit(x,y)) return true; + if (!actionsBg.hit(x,y)) return false; btn = null; @@ -244,22 +244,22 @@ public class Hud implements Disposable if (btn != null) btn.setOn(); - if (turns.contains(x,y)) { + if (turns.hit(x, y)) { ctrl.endPlayerTurn(); return true; } - if (reinforcement.contains(x,y)) { + if (reinforcement.hit(x, y)) { unitDock.toggle(); return true; } - if (unitDock.contains(x,y)) { + if (unitDock.hit(x, y)) { System.err.println("TODO unitDock touched"); return true; } - if (!actionsBg.contains(x,y)) return false; + if (!actionsBg.hit(x, y)) return false; if (btn == moveBtn) ctrl.setState(State.StateType.MOVE); diff --git a/core/src/ch/asynk/tankontank/game/hud/Bg.java b/core/src/ch/asynk/tankontank/game/hud/Bg.java index f862088..c88b985 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Bg.java +++ b/core/src/ch/asynk/tankontank/game/hud/Bg.java @@ -27,7 +27,7 @@ public class Bg implements Drawable, Disposable rect.height = h; } - public boolean contains(float x, float y) + public boolean hit(float x, float y) { return rect.contains(x, y); } diff --git a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java index c111165..5e76c8e 100644 --- a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java +++ b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java @@ -70,7 +70,7 @@ public class UnitDock extends Bg } @Override - public boolean contains(float x, float y) + public boolean hit(float x, float y) { return scaledRect.contains(x, y); } |