Removed hard-coded values, shrunk ball

This commit is contained in:
BlueNutterfly 2018-11-11 11:55:50 +04:00
parent ace35e1a2c
commit 4c3add8378
3 changed files with 9 additions and 4 deletions

View File

@ -74,4 +74,8 @@ public class BrickBuster extends ApplicationAdapter {
public Paddle getPaddle() { public Paddle getPaddle() {
return paddle; return paddle;
} }
public ArrayList<Block> getBlocks() {
return blocks;
}
} }

View File

@ -7,14 +7,14 @@ import com.me.brickbuster.BrickBuster;
public class Ball extends Entity { public class Ball extends Entity {
public static final int RADIUS = 25; public static final int RADIUS = 20;
public static final Color BALL_COLOR = Color.CHARTREUSE; public static final Color BALL_COLOR = Color.CHARTREUSE;
public Vector2 direction; public Vector2 direction;
public float speed; public float speed;
public Ball(BrickBuster brickBuster) { public Ball(BrickBuster brickBuster) {
super(brickBuster, 400, 83); super(brickBuster, BrickBuster.WIDTH/2, Paddle.PADDLE_Y + RADIUS + Paddle.PADDLE_HEIGHT/2);
} }
@Override @Override

View File

@ -10,10 +10,11 @@ public class Paddle extends Entity {
public static final Color PADDLE_COLOR = Color.BLACK; public static final Color PADDLE_COLOR = Color.BLACK;
public static final int PADDLE_WIDTH = 100; public static final int PADDLE_WIDTH = 100;
public static final int PADDLE_HEIGHT = 15; public static final int PADDLE_HEIGHT = 16;
public static final int PADDLE_Y = 50;
public Paddle(BrickBuster brickBuster) { public Paddle(BrickBuster brickBuster) {
super(brickBuster, BrickBuster.WIDTH/2, 50); super(brickBuster, BrickBuster.WIDTH/2, PADDLE_Y);
} }
@Override @Override