diff --git a/src/main/java/inf112/fiasko/roborally/objects/IDrawableGame.java b/src/main/java/inf112/fiasko/roborally/objects/IDrawableGame.java index 847f158..0c059b2 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/IDrawableGame.java +++ b/src/main/java/inf112/fiasko/roborally/objects/IDrawableGame.java @@ -39,6 +39,16 @@ public interface IDrawableGame { */ List getWallsToDraw(); + /** + * Gets a list of all the particles to be drawn + * + * Should return a list readable from top-left to top-right and so on. In other words, the first getWidth() + * particles should be drawn on the top row from left to right. + * + * @return A list of particles + */ + List getParticlesToDraw(); + /** * Gets a list of all robots to draw * @return A list of all robots to draw diff --git a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java index 0547f63..d7f16f3 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java +++ b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java @@ -50,6 +50,11 @@ public class RoboRallyGame implements IDrawableGame { return gameBoard.getWalls(); } + @Override + public List getParticlesToDraw() { + return gameBoard.getParticles(); + } + @Override public List getRobotsToDraw() { return gameBoard.getAliveRobots(); @@ -97,7 +102,7 @@ public class RoboRallyGame implements IDrawableGame { robots.add(new Robot(RobotID.ROBOT_6, new Position(7, 7))); robots.add(new Robot(RobotID.ROBOT_7, new Position(6, 7))); robots.add(new Robot(RobotID.ROBOT_8, new Position(6, 8))); - gameBoard = BoardLoaderUtil.loadBoard("boards/Checkmate.txt", robots); + gameBoard = BoardLoaderUtil.loadBoard("boards/Dizzy_Dash.txt", robots); cogwheels = gameBoard.getPositionsOfTileOnBoard(TileType.COGWHEEL_RIGHT, TileType.COGWHEEL_LEFT); fastConveyorBelts = gameBoard.getPositionsOfTileOnBoard(TileType.CONVEYOR_BELT_FAST, @@ -133,6 +138,7 @@ public class RoboRallyGame implements IDrawableGame { TimeUnit.SECONDS.sleep(3); makeMove(RobotID.ROBOT_1, Action.MOVE_1); makeMove(RobotID.ROBOT_1, Action.MOVE_2); + fireAllLasers(); makeMove(RobotID.ROBOT_1, Action.BACK_UP); makeMove(RobotID.ROBOT_1, Action.BACK_UP); makeMove(RobotID.ROBOT_1, Action.MOVE_3); @@ -157,7 +163,6 @@ public class RoboRallyGame implements IDrawableGame { checkAllFlags(); rotateCogwheels(); makeMove(RobotID.ROBOT_7, Action.MOVE_1); - fireAllLasers(); } /** @@ -365,6 +370,9 @@ public class RoboRallyGame implements IDrawableGame { } } + /** + * Fires all lasers on the game board + */ private void fireAllLasers() { gameBoard.fireAllLasers(); }