From 9e8e00e9afa789cbc794d3994a9d6af09a49d4d7 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Thu, 22 Nov 2018 17:34:18 +0400 Subject: [PATCH] Add random shape and type control to GridLevelLoader --- .../src/com/me/brickbuster/layout/GridLevelLoader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/com/me/brickbuster/layout/GridLevelLoader.java b/core/src/com/me/brickbuster/layout/GridLevelLoader.java index 4ad351b..2fa325c 100644 --- a/core/src/com/me/brickbuster/layout/GridLevelLoader.java +++ b/core/src/com/me/brickbuster/layout/GridLevelLoader.java @@ -10,16 +10,24 @@ public class GridLevelLoader implements LevelLoader { public static final int ROUNDS = 2; private PlayState state; + private boolean randomShape; + private boolean randomType; private int playCount = 0; public GridLevelLoader(PlayState state) { + this(state, false, false) + } + + public GridLevelLoader(PlayState state, boolean randomShape, boolean randomType) { this.state = state; + this.randomShape = randomShape; + this.randomType = randomType; } @Override public Level getNextLevel() { if (playCount++ < ROUNDS) { - return new Level(new GridLayout(state, COLUMNS, ROWS, POWER_UP_CHANCE, true, true)); + return new Level(new GridLayout(state, COLUMNS, ROWS, POWER_UP_CHANCE, randomShape, randomType)); } return null; }