mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-01 07:39:35 +01:00
Legger tilbake glemt transportbånd rotasjon
This commit is contained in:
parent
9bda8244dd
commit
1667e72113
@ -301,6 +301,12 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
if (gameBoard.isConveyorBelt(gameBoard.getTileOnPosition(newPosition))) {
|
if (gameBoard.isConveyorBelt(gameBoard.getTileOnPosition(newPosition))) {
|
||||||
newPositions.put(robotAtConveyorBelt, newPosition);
|
newPositions.put(robotAtConveyorBelt, newPosition);
|
||||||
moveNormally.put(robotAtConveyorBelt, false);
|
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 {
|
} else {
|
||||||
newPositions.put(robotAtConveyorBelt, conveyorBeltPosition);
|
newPositions.put(robotAtConveyorBelt, conveyorBeltPosition);
|
||||||
moveNormally.put(robotAtConveyorBelt, true);
|
moveNormally.put(robotAtConveyorBelt, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user