From 268506a0840fffbfc2fbb19aba06fe5eb779d9bf Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 18 Mar 2022 11:02:53 +0100 Subject: [PATCH] fixed errors in calculateWinner --- src/main/java/ch/zhaw/pm2/racetrack/Game.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/zhaw/pm2/racetrack/Game.java b/src/main/java/ch/zhaw/pm2/racetrack/Game.java index 457d278..e59c530 100644 --- a/src/main/java/ch/zhaw/pm2/racetrack/Game.java +++ b/src/main/java/ch/zhaw/pm2/racetrack/Game.java @@ -283,7 +283,7 @@ public class Game implements GameSpecification { if(start.getY() < finish.getY()) { track.getCar(carIndex).increaseWinPoints(); } - else if(start.getY() < finish.getY()) { + else if(start.getY() > finish.getY()) { track.getCar(carIndex).deductWinPoints(); } break; @@ -299,7 +299,7 @@ public class Game implements GameSpecification { if(start.getX() < finish.getX()){ track.getCar(carIndex).increaseWinPoints(); } - else if (start.getX() < finish.getX()){ + else if (start.getX() > finish.getX()){ track.getCar(carIndex).deductWinPoints(); } break;