From 1667e7211362c6e7b92dea00452c5a755fda8a8e Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Wed, 25 Mar 2020 14:25:11 +0100 Subject: [PATCH] =?UTF-8?q?Legger=20tilbake=20glemt=20transportb=C3=A5nd?= =?UTF-8?q?=20rotasjon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/inf112/fiasko/roborally/objects/RoboRallyGame.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java index 8041aec..68b4041 100644 --- a/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java +++ b/src/main/java/inf112/fiasko/roborally/objects/RoboRallyGame.java @@ -301,6 +301,12 @@ public class RoboRallyGame implements IDrawableGame { if (gameBoard.isConveyorBelt(gameBoard.getTileOnPosition(newPosition))) { newPositions.put(robotAtConveyorBelt, newPosition); moveNormally.put(robotAtConveyorBelt, false); + Direction newDirection = gameBoard.getTileOnPosition(newPosition).getDirection(); + if (Direction.getRightRotatedDirection(newDirection) == conveyorBeltDirection) { + gameBoard.rotateRobotLeft(robotAtConveyorBelt); + } else if (Direction.getLeftRotatedDirection(newDirection) == conveyorBeltDirection) { + gameBoard.rotateRobotRight(robotAtConveyorBelt); + } } else { newPositions.put(robotAtConveyorBelt, conveyorBeltPosition); moveNormally.put(robotAtConveyorBelt, true);