diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java b/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java index f714203..dd1c648 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/SpriteNode.java @@ -7,30 +7,28 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public abstract class SpriteNode extends Sprite implements Node { + private Texture texture; + public SpriteNode(Texture texture) { super(texture); + this.texture = texture; } public SpriteNode(TextureRegion region) { super(region); + this.texture = null; } @Override public void dispose() { - // FIXME : what to do with dispose in SpriteNode - } - - @Override - public void moveBy(float dx, float dy) - { - translate(dx, dy); + if (texture != null) texture.dispose(); } @Override - public void setCoords(float x, float y, float r) + public void setPosition(float x, float y, float r) { setPosition(x, y); setRotation(r); |