mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed race timer to display real race time, and made race time scalable.
#story[445]
This commit is contained in:
@@ -88,7 +88,7 @@ public class Race {
|
||||
int numberOfMarks = this.course.size();
|
||||
|
||||
for (int i = 0; i < numberOfMarks; i++) {
|
||||
Double time = (1000 * totalDistance / boat.getVelocity());
|
||||
Double time = (totalDistance / boat.getVelocity() / timeScale);
|
||||
|
||||
// If there are singleMarks after this event
|
||||
if (i < numberOfMarks - 1) {
|
||||
@@ -101,6 +101,8 @@ public class Race {
|
||||
events.put(boat, new ArrayList<>(Arrays.asList(event)));
|
||||
}
|
||||
totalDistance += event.getDistanceBetweenMarks();
|
||||
System.out.println(totalDistance);
|
||||
System.out.println(boat.getVelocity());
|
||||
}
|
||||
|
||||
// There are no more marks after this event
|
||||
@@ -190,6 +192,6 @@ public class Race {
|
||||
* Increment the race time by one second
|
||||
*/
|
||||
public void incrementRaceTime(){
|
||||
this.raceTime ++;
|
||||
this.raceTime += this.timeScale;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user