From 1f9c2e6db0005e4feb73056ce73e610bf1ea692d Mon Sep 17 00:00:00 2001 From: Matt Low Date: Mon, 12 Nov 2018 09:54:07 +0400 Subject: [PATCH] Decrease chance of glue powerup dropping from 50% to 8% Increase default ball speed to 350px/sec Change paddle speed control to time-based, 375px/sec --- core/src/com/me/brickbuster/BrickBuster.java | 2 +- core/src/com/me/brickbuster/entity/Ball.java | 2 +- core/src/com/me/brickbuster/entity/Paddle.java | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/com/me/brickbuster/BrickBuster.java b/core/src/com/me/brickbuster/BrickBuster.java index 782f0e3..faa335d 100644 --- a/core/src/com/me/brickbuster/BrickBuster.java +++ b/core/src/com/me/brickbuster/BrickBuster.java @@ -36,7 +36,7 @@ public class BrickBuster extends ApplicationAdapter { int x = 15 + (col * (Brick.BLOCK_WIDTH + 10)); int y = 15 + Brick.BLOCK_HEIGHT + (row * (Brick.BLOCK_HEIGHT + 10)); Class powerUpType = null; - if (MathUtils.randomBoolean(0.5f)) { + if (MathUtils.randomBoolean(0.08f)) { powerUpType = GluePowerUp.class; } bricks.add(new Brick(this, powerUpType, x, HEIGHT - y)); diff --git a/core/src/com/me/brickbuster/entity/Ball.java b/core/src/com/me/brickbuster/entity/Ball.java index 31e57dd..74f05b7 100644 --- a/core/src/com/me/brickbuster/entity/Ball.java +++ b/core/src/com/me/brickbuster/entity/Ball.java @@ -14,7 +14,7 @@ public class Ball extends Entity { public static final int RADIUS = 12; public static final Color BALL_COLOR = Color.CHARTREUSE; - public static final float DEFAULT_SPEED = 300; + public static final float DEFAULT_SPEED = 350; public static final float BOOST_SPEED = 450; public static final int BLOCKS_FOR_BOOST = 39; diff --git a/core/src/com/me/brickbuster/entity/Paddle.java b/core/src/com/me/brickbuster/entity/Paddle.java index f974965..820d485 100644 --- a/core/src/com/me/brickbuster/entity/Paddle.java +++ b/core/src/com/me/brickbuster/entity/Paddle.java @@ -14,7 +14,7 @@ public class Paddle extends Entity { public static final int PADDLE_WIDTH = 100; public static final int PADDLE_HEIGHT = 10; public static final int PADDLE_Y = 15; - public static final int PADDLE_SPEED = 6; + public static final int PADDLE_SPEED = 375; private boolean sticky = false; @@ -34,21 +34,21 @@ public class Paddle extends Entity { public void update(float dt) { Ball ball = getBrickBuster().getBall(); if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) { - if (getX() - PADDLE_SPEED < 0) { + if (getX() - PADDLE_SPEED * dt < 0) { return; } - setX(getX() - PADDLE_SPEED); + setX(getX() - PADDLE_SPEED * dt); if (!getBrickBuster().isPlaying() || ball.isStuck()) { - ball.setX(ball.getX() - PADDLE_SPEED); + ball.setX(ball.getX() - PADDLE_SPEED * dt); } } if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) { - if (getX() + PADDLE_SPEED + PADDLE_WIDTH > BrickBuster.WIDTH) { + if (getX() + PADDLE_SPEED * dt + PADDLE_WIDTH > BrickBuster.WIDTH) { return; } - setX(getX() + PADDLE_SPEED); + setX(getX() + PADDLE_SPEED * dt); if (!getBrickBuster().isPlaying() || ball.isStuck()) { - ball.setX(ball.getX() + PADDLE_SPEED); + ball.setX(ball.getX() + PADDLE_SPEED * dt); } } }