Added test for race dnf in Race class.
-Unable to test animation timer. #story[778]
This commit is contained in:
@@ -31,6 +31,8 @@ public class Race implements Runnable {
|
||||
protected long totalTimeElapsed;
|
||||
protected int scaleFactor;
|
||||
protected int PRERACE_TIME = 12; //time in milliseconds to pause during pre-race
|
||||
protected boolean countdownFinish = false;
|
||||
protected boolean runRace = true;
|
||||
private int lastFPS = 20;
|
||||
private int raceId;
|
||||
private int dnfChance = 0; //percentage chance a boat fails at each checkpoint
|
||||
@@ -119,8 +121,11 @@ public class Race implements Runnable {
|
||||
public void handle(long arg0) {
|
||||
timeLeft = startTime - currentTime;
|
||||
if (timeLeft <= 0) {
|
||||
countdownFinish = true;
|
||||
stop();
|
||||
simulateRace();
|
||||
if (runRace) {
|
||||
simulateRace();
|
||||
}
|
||||
} else {
|
||||
currentTimeInSeconds = (timeLeft * scaleFactor) / 1000;
|
||||
minutes = currentTimeInSeconds / 60;
|
||||
@@ -132,6 +137,7 @@ public class Race implements Runnable {
|
||||
}
|
||||
};
|
||||
timer.start();
|
||||
//countdownFinish = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user