diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:52:58 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-04 15:52:58 +0100 |
commit | 74fd1fc62bc3b617e8890ad8f27a53422eee1f74 (patch) | |
tree | 8b33b8f19d95f2c3b07e6b754f511dc9a84d6742 /core/src/ch | |
parent | 2823518ed1417dd0a7df5de3737c062cb7412673 (diff) | |
download | RustAndDust-74fd1fc62bc3b617e8890ad8f27a53422eee1f74.zip RustAndDust-74fd1fc62bc3b617e8890ad8f27a53422eee1f74.tar.gz |
Image: add public blocked
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/Image.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Image.java b/core/src/ch/asynk/tankontank/engine/gfx/Image.java index 1386679..daee617 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/Image.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/Image.java @@ -9,7 +9,8 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public class Image extends Sprite implements Drawable, Disposable { - public boolean visible ; + public boolean blocked; + public boolean visible; private Texture texture; protected Image() @@ -21,6 +22,7 @@ public class Image extends Sprite implements Drawable, Disposable super(texture); this.texture = texture; this.visible = true; + this.blocked = false; } public Image(TextureRegion region) @@ -28,6 +30,7 @@ public class Image extends Sprite implements Drawable, Disposable super(region); this.texture = null; this.visible = true; + this.blocked = false; } @Override @@ -38,7 +41,7 @@ public class Image extends Sprite implements Drawable, Disposable public boolean hit(float x, float y) { - if (!visible) return false; + if (blocked || !visible) return false; return ((x >= getX()) && (y >= getY()) && (x <= (getX() + getWidth())) && (y <= (getY() + getHeight()))); } |