diff --git a/core/src/com/me/brickbuster/entity/Brick.java b/core/src/com/me/brickbuster/entity/Brick.java index 24cccc9..3b64d7e 100644 --- a/core/src/com/me/brickbuster/entity/Brick.java +++ b/core/src/com/me/brickbuster/entity/Brick.java @@ -27,6 +27,7 @@ public class Brick extends Entity implements PhysicsBody, CollisionListener { public static final float BRICK_HEIGHT = 2.5f; private static final EarClippingTriangulator ECT = new EarClippingTriangulator(); + private static final Vector2 tmp = new Vector2(); private BrickType type; private BrickShape shape; @@ -40,8 +41,6 @@ public class Brick extends Entity implements PhysicsBody, CollisionListener { private Body body; private boolean hitByBall = false; - private final Vector2 tmp = new Vector2(); - public Brick(PlayState state, PowerUpType powerUpType, float x, float y) { this(state, powerUpType, true, x, y); } @@ -209,6 +208,12 @@ public class Brick extends Entity implements PhysicsBody, CollisionListener { public void endContact(Entity contacted) { } + @Override + public void dispose() { + solid.dispose(); + pm.dispose(); + } + public boolean hit() { if (state.bricks.size-1 <= Ball.BLOCKS_FOR_BOOST) { for (Ball ball : state.balls) { diff --git a/core/src/com/me/brickbuster/entity/Entity.java b/core/src/com/me/brickbuster/entity/Entity.java index 66b7cf4..a0ee15e 100644 --- a/core/src/com/me/brickbuster/entity/Entity.java +++ b/core/src/com/me/brickbuster/entity/Entity.java @@ -23,6 +23,8 @@ public abstract class Entity { public abstract void update(float dt); + public void dispose() {} + public Vector2 getPos() { return pos; }