diff --git a/core/src/com/me/brickbuster/BrickBuster.java b/core/src/com/me/brickbuster/BrickBuster.java index 107874d..9fb6196 100644 --- a/core/src/com/me/brickbuster/BrickBuster.java +++ b/core/src/com/me/brickbuster/BrickBuster.java @@ -20,11 +20,12 @@ public class BrickBuster extends ApplicationAdapter { public static final int HEIGHT = 600; public static final String TITLE = "Brick Buster"; - public static final int SHIELD_HEIGHT = 5; - public static final Vector2 HORIZONTAL_EDGE = new Vector2(1, 0); public static final Vector2 VERTICAL_EDGE = new Vector2(0, 1); + public static final int SHIELD_HEIGHT = 5; + public static final float POWERUP_CHANCE = 0.15f; + private static final Map, Integer> powerUpWeights; private static final int weightSum; @@ -55,7 +56,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.15f)) { + if (MathUtils.randomBoolean(POWERUP_CHANCE)) { powerUpType = getWeightedPowerUp(); } bricks.add(new Brick(this, powerUpType, x, HEIGHT - y));