From 4c3add83782513607c6f92bb80aeda6b42640db2 Mon Sep 17 00:00:00 2001 From: BlueNutterfly Date: Sun, 11 Nov 2018 11:55:50 +0400 Subject: [PATCH] Removed hard-coded values, shrunk ball --- core/src/com/me/brickbuster/BrickBuster.java | 4 ++++ core/src/com/me/brickbuster/entity/Ball.java | 4 ++-- core/src/com/me/brickbuster/entity/Paddle.java | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/com/me/brickbuster/BrickBuster.java b/core/src/com/me/brickbuster/BrickBuster.java index 229e99f..a438c22 100644 --- a/core/src/com/me/brickbuster/BrickBuster.java +++ b/core/src/com/me/brickbuster/BrickBuster.java @@ -74,4 +74,8 @@ public class BrickBuster extends ApplicationAdapter { public Paddle getPaddle() { return paddle; } + + public ArrayList getBlocks() { + return blocks; + } } diff --git a/core/src/com/me/brickbuster/entity/Ball.java b/core/src/com/me/brickbuster/entity/Ball.java index 494cca2..ba77c94 100644 --- a/core/src/com/me/brickbuster/entity/Ball.java +++ b/core/src/com/me/brickbuster/entity/Ball.java @@ -7,14 +7,14 @@ import com.me.brickbuster.BrickBuster; 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 Vector2 direction; public float speed; public Ball(BrickBuster brickBuster) { - super(brickBuster, 400, 83); + super(brickBuster, BrickBuster.WIDTH/2, Paddle.PADDLE_Y + RADIUS + Paddle.PADDLE_HEIGHT/2); } @Override diff --git a/core/src/com/me/brickbuster/entity/Paddle.java b/core/src/com/me/brickbuster/entity/Paddle.java index c0c386f..19702b0 100644 --- a/core/src/com/me/brickbuster/entity/Paddle.java +++ b/core/src/com/me/brickbuster/entity/Paddle.java @@ -10,10 +10,11 @@ public class Paddle extends Entity { public static final Color PADDLE_COLOR = Color.BLACK; 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) { - super(brickBuster, BrickBuster.WIDTH/2, 50); + super(brickBuster, BrickBuster.WIDTH/2, PADDLE_Y); } @Override