Remove magic value
This commit is contained in:
parent
e2c0bad9e0
commit
b3cbe0cda5
@ -12,6 +12,7 @@ import net.dermetfan.utils.Pair;
|
|||||||
|
|
||||||
public class Paddle extends Entity {
|
public class Paddle extends Entity {
|
||||||
|
|
||||||
|
public static final Color STICKY_COLOR = Color.GRAY;
|
||||||
public static final Color PADDLE_COLOR = Color.BLACK;
|
public static final Color PADDLE_COLOR = Color.BLACK;
|
||||||
public static final int DEFAULT_WIDTH = 300;
|
public static final int DEFAULT_WIDTH = 300;
|
||||||
public static final int PADDLE_HEIGHT = 30;
|
public static final int PADDLE_HEIGHT = 30;
|
||||||
@ -28,7 +29,7 @@ public class Paddle extends Entity {
|
|||||||
@Override
|
@Override
|
||||||
public void render(ShapeRenderer sr) {
|
public void render(ShapeRenderer sr) {
|
||||||
sr.begin(ShapeType.Filled);
|
sr.begin(ShapeType.Filled);
|
||||||
sr.setColor(sticky? Color.GRAY : PADDLE_COLOR);
|
sr.setColor(sticky? STICKY_COLOR : PADDLE_COLOR);
|
||||||
sr.rect(getX() - width/2, getY(), width, PADDLE_HEIGHT);
|
sr.rect(getX() - width/2, getY(), width, PADDLE_HEIGHT);
|
||||||
sr.end();
|
sr.end();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user