mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Compare commits
1 Commits
sprint_2.1
...
sprint_2.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 971a3920a3 |
@@ -150,7 +150,7 @@ public class CanvasController {
|
||||
*/
|
||||
private void drawWake(GraphicsContext gc, double x, double y, double speed, Color color, double heading){
|
||||
double angle = Math.toRadians(heading);
|
||||
speed = speed * 10;
|
||||
speed = speed * 2;
|
||||
Point newP = new Point(0, speed);
|
||||
newP.rotate(angle);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public class RaceViewController {
|
||||
for (Event event : events) {
|
||||
if (event.getIsFinishingEvent()) {
|
||||
keyFrames.add(
|
||||
new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5),
|
||||
new KeyFrame(Duration.seconds(event.getTime()),
|
||||
onFinished -> {race.setBoatFinished(boat); handleEvent(event);},
|
||||
new KeyValue(x, event.getThisMark().getLatitude()),
|
||||
new KeyValue(y, event.getThisMark().getLongitude())
|
||||
@@ -135,7 +135,7 @@ public class RaceViewController {
|
||||
);
|
||||
} else {
|
||||
keyFrames.add(
|
||||
new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5),
|
||||
new KeyFrame(Duration.seconds(event.getTime()),
|
||||
onFinished ->{
|
||||
handleEvent(event);
|
||||
boat.setHeading(event.getBoatHeading());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<configurations>
|
||||
<race-name>AC35</race-name>
|
||||
<race-size>6</race-size>
|
||||
<time-scale>1.0</time-scale>
|
||||
<time-scale>10.0</time-scale>
|
||||
<wind-direction>135</wind-direction>
|
||||
</configurations>
|
||||
|
||||
|
||||
@@ -4,31 +4,31 @@
|
||||
<team>
|
||||
<name>Oracle Team USA</name>
|
||||
<alias>USA</alias>
|
||||
<velocity>1</velocity>
|
||||
<velocity>12.9</velocity>
|
||||
</team>
|
||||
<team>
|
||||
<name>Artemis Racing</name>
|
||||
<alias>ART</alias>
|
||||
<velocity>1.1</velocity>
|
||||
<velocity>13.1</velocity>
|
||||
</team>
|
||||
<team>
|
||||
<name>Emirates Team New Zealand</name>
|
||||
<alias>NZL</alias>
|
||||
<velocity>2</velocity>
|
||||
<velocity>15.6</velocity>
|
||||
</team>
|
||||
<team>
|
||||
<name>Land Rover BAR</name>
|
||||
<alias>BAR</alias>
|
||||
<velocity>1.3</velocity>
|
||||
<velocity>13.3</velocity>
|
||||
</team>
|
||||
<team>
|
||||
<name>SoftBank Team Japan</name>
|
||||
<alias>JAP</alias>
|
||||
<velocity>1.7</velocity>
|
||||
<velocity>14.7</velocity>
|
||||
</team>
|
||||
<team>
|
||||
<name>Groupama Team France</name>
|
||||
<alias>FRC</alias>
|
||||
<velocity>1.4</velocity>
|
||||
<velocity>11.4</velocity>
|
||||
</team>
|
||||
</teams>
|
||||
Reference in New Issue
Block a user