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
This commit is contained in:
parent
3e0d4657f2
commit
1f9c2e6db0
@ -36,7 +36,7 @@ public class BrickBuster extends ApplicationAdapter {
|
|||||||
int x = 15 + (col * (Brick.BLOCK_WIDTH + 10));
|
int x = 15 + (col * (Brick.BLOCK_WIDTH + 10));
|
||||||
int y = 15 + Brick.BLOCK_HEIGHT + (row * (Brick.BLOCK_HEIGHT + 10));
|
int y = 15 + Brick.BLOCK_HEIGHT + (row * (Brick.BLOCK_HEIGHT + 10));
|
||||||
Class<? extends PowerUp> powerUpType = null;
|
Class<? extends PowerUp> powerUpType = null;
|
||||||
if (MathUtils.randomBoolean(0.5f)) {
|
if (MathUtils.randomBoolean(0.08f)) {
|
||||||
powerUpType = GluePowerUp.class;
|
powerUpType = GluePowerUp.class;
|
||||||
}
|
}
|
||||||
bricks.add(new Brick(this, powerUpType, x, HEIGHT - y));
|
bricks.add(new Brick(this, powerUpType, x, HEIGHT - y));
|
||||||
|
@ -14,7 +14,7 @@ public class Ball extends Entity {
|
|||||||
|
|
||||||
public static final int RADIUS = 12;
|
public static final int RADIUS = 12;
|
||||||
public static final Color BALL_COLOR = Color.CHARTREUSE;
|
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 float BOOST_SPEED = 450;
|
||||||
public static final int BLOCKS_FOR_BOOST = 39;
|
public static final int BLOCKS_FOR_BOOST = 39;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class Paddle extends Entity {
|
|||||||
public static final int PADDLE_WIDTH = 100;
|
public static final int PADDLE_WIDTH = 100;
|
||||||
public static final int PADDLE_HEIGHT = 10;
|
public static final int PADDLE_HEIGHT = 10;
|
||||||
public static final int PADDLE_Y = 15;
|
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;
|
private boolean sticky = false;
|
||||||
|
|
||||||
@ -34,21 +34,21 @@ public class Paddle extends Entity {
|
|||||||
public void update(float dt) {
|
public void update(float dt) {
|
||||||
Ball ball = getBrickBuster().getBall();
|
Ball ball = getBrickBuster().getBall();
|
||||||
if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) {
|
if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) {
|
||||||
if (getX() - PADDLE_SPEED < 0) {
|
if (getX() - PADDLE_SPEED * dt < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setX(getX() - PADDLE_SPEED);
|
setX(getX() - PADDLE_SPEED * dt);
|
||||||
if (!getBrickBuster().isPlaying() || ball.isStuck()) {
|
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 (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) {
|
||||||
if (getX() + PADDLE_SPEED + PADDLE_WIDTH > BrickBuster.WIDTH) {
|
if (getX() + PADDLE_SPEED * dt + PADDLE_WIDTH > BrickBuster.WIDTH) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setX(getX() + PADDLE_SPEED);
|
setX(getX() + PADDLE_SPEED * dt);
|
||||||
if (!getBrickBuster().isPlaying() || ball.isStuck()) {
|
if (!getBrickBuster().isPlaying() || ball.isStuck()) {
|
||||||
ball.setX(ball.getX() + PADDLE_SPEED);
|
ball.setX(ball.getX() + PADDLE_SPEED * dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user