Refactor powerups, move to new package. Decrease long paddle chance to 8%
This commit is contained in:
parent
88428fded9
commit
d3eb876960
@ -6,6 +6,9 @@ import com.badlogic.gdx.graphics.GL20;
|
|||||||
import com.badlogic.gdx.math.MathUtils;
|
import com.badlogic.gdx.math.MathUtils;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.me.brickbuster.entity.*;
|
import com.me.brickbuster.entity.*;
|
||||||
|
import com.me.brickbuster.entity.powerup.GluePowerUp;
|
||||||
|
import com.me.brickbuster.entity.powerup.LongerPaddlePowerUp;
|
||||||
|
import com.me.brickbuster.entity.powerup.PowerUp;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@ -39,7 +42,7 @@ public class BrickBuster extends ApplicationAdapter {
|
|||||||
if (MathUtils.randomBoolean(0.08f)) {
|
if (MathUtils.randomBoolean(0.08f)) {
|
||||||
powerUpType = GluePowerUp.class;
|
powerUpType = GluePowerUp.class;
|
||||||
}
|
}
|
||||||
else if (MathUtils.randomBoolean(0.25f)) {
|
else if (MathUtils.randomBoolean(0.08f)) {
|
||||||
powerUpType = LongerPaddlePowerUp.class;
|
powerUpType = LongerPaddlePowerUp.class;
|
||||||
}
|
}
|
||||||
bricks.add(new Brick(this, powerUpType, x, HEIGHT - y));
|
bricks.add(new Brick(this, powerUpType, x, HEIGHT - y));
|
||||||
|
@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color;
|
|||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.me.brickbuster.BrickBuster;
|
import com.me.brickbuster.BrickBuster;
|
||||||
|
import com.me.brickbuster.entity.powerup.PowerUp;
|
||||||
|
|
||||||
public class Brick extends Entity {
|
public class Brick extends Entity {
|
||||||
public static final Color BLOCK_COLOR = Color.FOREST;
|
public static final Color BLOCK_COLOR = Color.FOREST;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.me.brickbuster.entity;
|
package com.me.brickbuster.entity.powerup;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.me.brickbuster.BrickBuster;
|
import com.me.brickbuster.BrickBuster;
|
||||||
|
import com.me.brickbuster.entity.Brick;
|
||||||
|
|
||||||
public class GluePowerUp extends PowerUp {
|
public class GluePowerUp extends PowerUp {
|
||||||
|
|
@ -1,7 +1,9 @@
|
|||||||
package com.me.brickbuster.entity;
|
package com.me.brickbuster.entity.powerup;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.me.brickbuster.BrickBuster;
|
import com.me.brickbuster.BrickBuster;
|
||||||
|
import com.me.brickbuster.entity.Brick;
|
||||||
|
import com.me.brickbuster.entity.Paddle;
|
||||||
|
|
||||||
public class LongerPaddlePowerUp extends PowerUp {
|
public class LongerPaddlePowerUp extends PowerUp {
|
||||||
public LongerPaddlePowerUp(BrickBuster brickBuster, Brick brick) {
|
public LongerPaddlePowerUp(BrickBuster brickBuster, Brick brick) {
|
@ -1,10 +1,12 @@
|
|||||||
package com.me.brickbuster.entity;
|
package com.me.brickbuster.entity.powerup;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.me.brickbuster.BrickBuster;
|
import com.me.brickbuster.BrickBuster;
|
||||||
import com.me.brickbuster.Utils;
|
import com.me.brickbuster.Utils;
|
||||||
|
import com.me.brickbuster.entity.Brick;
|
||||||
|
import com.me.brickbuster.entity.Entity;
|
||||||
import net.dermetfan.utils.Pair;
|
import net.dermetfan.utils.Pair;
|
||||||
|
|
||||||
public abstract class PowerUp extends Entity {
|
public abstract class PowerUp extends Entity {
|
Loading…
Reference in New Issue
Block a user