Decreased brick size, increased edge padding, removed brick padding
Field is now 11 bricks wide instead of 10 Extended edge padding to Y=0
This commit is contained in:
parent
2a40bcabdf
commit
3fdd394e36
@ -22,8 +22,8 @@ import com.me.brickbuster.state.PlayState;
|
||||
|
||||
public class Brick extends Entity implements PhysicsBody, CollisionListener {
|
||||
|
||||
public static final float BRICK_WIDTH = 5f;
|
||||
public static final float BRICK_HEIGHT = 2.5f;
|
||||
public static final float BRICK_WIDTH = 4.6f;
|
||||
public static final float BRICK_HEIGHT = 2.3f;
|
||||
|
||||
private static final EarClippingTriangulator ECT = new EarClippingTriangulator();
|
||||
private static final Vector2 tmp = new Vector2();
|
||||
@ -79,7 +79,7 @@ public class Brick extends Entity implements PhysicsBody, CollisionListener {
|
||||
hitByBall = false;
|
||||
}
|
||||
|
||||
if (getY() - BRICK_HEIGHT < 0) {
|
||||
if (getY() + BRICK_HEIGHT < 0) {
|
||||
delete();
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ public class GridLayout implements BrickLayout {
|
||||
private final int cols;
|
||||
private final int rows;
|
||||
private final float powerUpChance;
|
||||
private final float brick_padding;
|
||||
|
||||
private BrickShape.Shape shape = null;
|
||||
private BrickType type = null;
|
||||
@ -38,7 +37,6 @@ public class GridLayout implements BrickLayout {
|
||||
this.state = state;
|
||||
this.cols = cols;
|
||||
this.rows = rows;
|
||||
this.brick_padding = (PlayState.BOARD_WIDTH - cols * Brick.BRICK_WIDTH) / (cols + 1);
|
||||
this.powerUpChance = powerUpChance;
|
||||
this.shape = shape;
|
||||
this.type = type;
|
||||
@ -55,8 +53,8 @@ public class GridLayout implements BrickLayout {
|
||||
}
|
||||
|
||||
protected Brick getBrickForCell(int row, int col) {
|
||||
final float x = brick_padding + Brick.BRICK_WIDTH/2 + (col * (Brick.BRICK_WIDTH + brick_padding));
|
||||
final float y = brick_padding + Brick.BRICK_HEIGHT/2 + (row * (Brick.BRICK_HEIGHT + brick_padding));
|
||||
final float x = PlayState.EDGE_PADDING + Brick.BRICK_WIDTH/2 + col * Brick.BRICK_WIDTH;
|
||||
final float y = PlayState.EDGE_PADDING + Brick.BRICK_HEIGHT/2 + row * Brick.BRICK_HEIGHT;
|
||||
|
||||
PowerUpType powerUpType = null;
|
||||
if (MathUtils.randomBoolean(powerUpChance)) {
|
||||
|
@ -5,7 +5,7 @@ import com.me.brickbuster.state.PlayState;
|
||||
public class GridLevelLoader implements LevelLoader {
|
||||
|
||||
public static final float POWER_UP_CHANCE = 0.15f;
|
||||
public static final int COLUMNS = 10;
|
||||
public static final int COLUMNS = 11;
|
||||
public static final int ROWS = 20;
|
||||
public static final int ROUNDS = 2;
|
||||
|
||||
|
@ -19,12 +19,12 @@ public class PlayState extends FieldState {
|
||||
public static final float PIXEL_PER_METER = 40f; // Board dimension: 54x96 meters
|
||||
public static final float BOARD_WIDTH = 54f;
|
||||
public static final float BOARD_HEIGHT = 96f;
|
||||
public static final float EDGE_PADDING = .125f;
|
||||
public static final float EDGE_PADDING = 1.7f;
|
||||
|
||||
public static final Vector2 lowerLeftCorner =
|
||||
new Vector2(EDGE_PADDING,EDGE_PADDING);
|
||||
new Vector2(EDGE_PADDING,0);
|
||||
public static final Vector2 lowerRightCorner =
|
||||
new Vector2(BrickBuster.BOARD_WIDTH/PIXEL_PER_METER-EDGE_PADDING,EDGE_PADDING);
|
||||
new Vector2(BrickBuster.BOARD_WIDTH/PIXEL_PER_METER-EDGE_PADDING,0);
|
||||
public static final Vector2 upperRightCorner =
|
||||
new Vector2(BrickBuster.BOARD_WIDTH/PIXEL_PER_METER-EDGE_PADDING, BrickBuster.BOARD_HEIGHT/PIXEL_PER_METER-EDGE_PADDING);
|
||||
public static final Vector2 upperLeftCorner =
|
||||
|
Loading…
Reference in New Issue
Block a user