mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-07-24 16:55:27 +02:00
Merge branch 'master' of https://github.com/inf112-v20/Fiasko
This commit is contained in:
@@ -50,18 +50,17 @@ public class WinnerScreen extends AbstractScreen {
|
||||
|
||||
@Override
|
||||
public void render(float delta) {
|
||||
Gdx.gl.glClearColor(0.2f, 1f, 0.2f, 1);
|
||||
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||
camera.update();
|
||||
roboRallyWrapper.batch.setProjectionMatrix(camera.combined);
|
||||
|
||||
roboRallyWrapper.batch.begin();
|
||||
roboRallyWrapper.font.draw(roboRallyWrapper.batch, "The winner is: " +
|
||||
roboRallyWrapper.roboRallyGame.getWinningPlayerName(), applicationWidth / 2f - 380 / 2f,
|
||||
applicationHeight / 2f + 100, 380, 1,
|
||||
roboRallyWrapper.font.draw(roboRallyWrapper.batch, "The winner is: ", applicationWidth / 2f - 380 / 2f,
|
||||
applicationHeight / 2f + 300, 380, 1,
|
||||
true);
|
||||
roboRallyWrapper.font.draw(roboRallyWrapper.batch, "Click the button to exit the game",
|
||||
applicationWidth / 2f - 380 / 2f, applicationHeight / 2f + 100, 380, 1,
|
||||
applicationWidth / 2f - 380 / 2f, applicationHeight / 2f + 150, 380, 1,
|
||||
true);
|
||||
roboRallyWrapper.batch.end();
|
||||
stage.draw();
|
||||
|
@@ -401,20 +401,20 @@ public class Board {
|
||||
private boolean hasCrossingConflict(Position crossingPosition, Direction conveyorBeltDirection) {
|
||||
Position frontLeftPosition = getNewPosition(crossingPosition,
|
||||
Direction.getLeftRotatedDirection(conveyorBeltDirection));
|
||||
Tile frontLeftTile = getTileOnPosition(frontLeftPosition);
|
||||
Position frontRightPosition = getNewPosition(crossingPosition,
|
||||
Direction.getRightRotatedDirection(conveyorBeltDirection));
|
||||
Tile frontRightTile = getTileOnPosition(frontRightPosition);
|
||||
Position twoForwardPosition = getNewPosition(crossingPosition, conveyorBeltDirection);
|
||||
Tile twoForwardTile = getTileOnPosition(twoForwardPosition);
|
||||
//If another robot is standing on a conveyor belt pointing to the tile in front, a conflict happens
|
||||
return (isValidPosition(frontLeftPosition) && isConveyorBelt(frontLeftTile) && frontLeftTile.getDirection() ==
|
||||
return (isValidPosition(frontLeftPosition) && isConveyorBelt(getTileOnPosition(frontLeftPosition)) &&
|
||||
getTileOnPosition(frontLeftPosition).getDirection() ==
|
||||
Direction.getRightRotatedDirection(conveyorBeltDirection) && hasRobotOnPosition(frontLeftPosition)) ||
|
||||
(isValidPosition(frontRightPosition) && isConveyorBelt(frontRightTile)
|
||||
&& frontRightTile.getDirection() == Direction.getLeftRotatedDirection(conveyorBeltDirection)
|
||||
(isValidPosition(frontRightPosition) && isConveyorBelt(getTileOnPosition(frontRightPosition))
|
||||
&& getTileOnPosition(frontRightPosition).getDirection() ==
|
||||
Direction.getLeftRotatedDirection(conveyorBeltDirection)
|
||||
&& hasRobotOnPosition(frontRightPosition)) ||
|
||||
(isValidPosition(twoForwardPosition) && isConveyorBelt(twoForwardTile)
|
||||
&& twoForwardTile.getDirection() == Direction.getReverseDirection(conveyorBeltDirection)
|
||||
(isValidPosition(twoForwardPosition) && isConveyorBelt(getTileOnPosition(twoForwardPosition))
|
||||
&& getTileOnPosition(twoForwardPosition).getDirection() ==
|
||||
Direction.getReverseDirection(conveyorBeltDirection)
|
||||
&& hasRobotOnPosition(twoForwardPosition));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user