diff --git a/src/main/java/inf112/fiasko/roborally/game/Game.java b/src/main/java/inf112/fiasko/roborally/game/Game.java index 36e5e5d..4460334 100644 --- a/src/main/java/inf112/fiasko/roborally/game/Game.java +++ b/src/main/java/inf112/fiasko/roborally/game/Game.java @@ -24,6 +24,7 @@ public class Game implements IDrawableGame { try { List robots = new ArrayList<>(); robots.add(new Robot(RobotID.ROBOT_1, new Position(1, 1))); + robots.add(new Robot(RobotID.ROBOT_2, new Position(1, 2))); gameBoard = BoardLoaderUtil.loadBoard("boards/Checkmate.txt", robots); new Thread(() -> { try { @@ -57,6 +58,14 @@ public class Game implements IDrawableGame { gameBoard.rotateRobotRight(RobotID.ROBOT_1); TimeUnit.SECONDS.sleep(1); gameBoard.moveRobot(RobotID.ROBOT_1, Direction.SOUTH); + TimeUnit.SECONDS.sleep(1); + gameBoard.moveRobot(RobotID.ROBOT_2, Direction.EAST); + TimeUnit.SECONDS.sleep(1); + gameBoard.moveRobot(RobotID.ROBOT_2, Direction.WEST); + TimeUnit.SECONDS.sleep(1); + gameBoard.moveRobot(RobotID.ROBOT_2, Direction.EAST); + TimeUnit.SECONDS.sleep(1); + gameBoard.moveRobot(RobotID.ROBOT_2, Direction.EAST); } @Override diff --git a/src/main/java/inf112/fiasko/roborally/utility/TextureConverterUtil.java b/src/main/java/inf112/fiasko/roborally/utility/TextureConverterUtil.java index fc87098..5755ac1 100644 --- a/src/main/java/inf112/fiasko/roborally/utility/TextureConverterUtil.java +++ b/src/main/java/inf112/fiasko/roborally/utility/TextureConverterUtil.java @@ -23,7 +23,8 @@ import java.util.Map; */ public final class TextureConverterUtil { private static final Texture textureSheet = new Texture(Gdx.files.internal("assets/tiles.png")); - private static final Texture robotTexture = new Texture(Gdx.files.internal("assets/Robot.png")); + private static final Texture robot1Texture = new Texture(Gdx.files.internal("assets/Robot.png")); + private static final Texture robot2Texture = new Texture(Gdx.files.internal("assets/Robot2.png")); private static Map tileSheetTileTextureMappings; private static Map tileSheetTileHasRotatedTextureMappings; private static Map tileSheetWallTextureMappings; @@ -83,7 +84,9 @@ public final class TextureConverterUtil { public static TextureRegion convertElement(Robot robot) { if (robot.getRobotId() == RobotID.ROBOT_1) { - return new TextureRegion(robotTexture, 0, 0, 64, 64); + return new TextureRegion(robot1Texture, 0, 0, 64, 64); + } else if (robot.getRobotId() == RobotID.ROBOT_2) { + return new TextureRegion(robot2Texture, 0, 0, 64, 64); } throw new IllegalArgumentException("Robot has no drawable texture."); } diff --git a/src/main/resources/assets/Robot2.png b/src/main/resources/assets/Robot2.png new file mode 100644 index 0000000..3540ab7 Binary files /dev/null and b/src/main/resources/assets/Robot2.png differ