mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7022be1979 | |||
| 971a3920a3 |
@@ -150,7 +150,7 @@ public class CanvasController {
|
|||||||
*/
|
*/
|
||||||
private void drawWake(GraphicsContext gc, double x, double y, double speed, Color color, double heading){
|
private void drawWake(GraphicsContext gc, double x, double y, double speed, Color color, double heading){
|
||||||
double angle = Math.toRadians(heading);
|
double angle = Math.toRadians(heading);
|
||||||
speed = speed * 10;
|
speed = speed * 2;
|
||||||
Point newP = new Point(0, speed);
|
Point newP = new Point(0, speed);
|
||||||
newP.rotate(angle);
|
newP.rotate(angle);
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class RaceViewController {
|
|||||||
for (Event event : events) {
|
for (Event event : events) {
|
||||||
if (event.getIsFinishingEvent()) {
|
if (event.getIsFinishingEvent()) {
|
||||||
keyFrames.add(
|
keyFrames.add(
|
||||||
new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5),
|
new KeyFrame(Duration.seconds(event.getTime()),
|
||||||
onFinished -> {race.setBoatFinished(boat); handleEvent(event);},
|
onFinished -> {race.setBoatFinished(boat); handleEvent(event);},
|
||||||
new KeyValue(x, event.getThisMark().getLatitude()),
|
new KeyValue(x, event.getThisMark().getLatitude()),
|
||||||
new KeyValue(y, event.getThisMark().getLongitude())
|
new KeyValue(y, event.getThisMark().getLongitude())
|
||||||
@@ -135,7 +135,7 @@ public class RaceViewController {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
keyFrames.add(
|
keyFrames.add(
|
||||||
new KeyFrame(Duration.seconds(event.getTime() / 60 / 60 / 5),
|
new KeyFrame(Duration.seconds(event.getTime()),
|
||||||
onFinished ->{
|
onFinished ->{
|
||||||
handleEvent(event);
|
handleEvent(event);
|
||||||
boat.setHeading(event.getBoatHeading());
|
boat.setHeading(event.getBoatHeading());
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class Race {
|
|||||||
int numberOfMarks = this.course.size();
|
int numberOfMarks = this.course.size();
|
||||||
|
|
||||||
for (int i = 0; i < numberOfMarks; i++) {
|
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 there are singleMarks after this event
|
||||||
if (i < numberOfMarks - 1) {
|
if (i < numberOfMarks - 1) {
|
||||||
@@ -101,6 +101,8 @@ public class Race {
|
|||||||
events.put(boat, new ArrayList<>(Arrays.asList(event)));
|
events.put(boat, new ArrayList<>(Arrays.asList(event)));
|
||||||
}
|
}
|
||||||
totalDistance += event.getDistanceBetweenMarks();
|
totalDistance += event.getDistanceBetweenMarks();
|
||||||
|
System.out.println(totalDistance);
|
||||||
|
System.out.println(boat.getVelocity());
|
||||||
}
|
}
|
||||||
|
|
||||||
// There are no more marks after this event
|
// There are no more marks after this event
|
||||||
@@ -190,6 +192,6 @@ public class Race {
|
|||||||
* Increment the race time by one second
|
* Increment the race time by one second
|
||||||
*/
|
*/
|
||||||
public void incrementRaceTime(){
|
public void incrementRaceTime(){
|
||||||
this.raceTime ++;
|
this.raceTime += this.timeScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<configurations>
|
<configurations>
|
||||||
<race-name>AC35</race-name>
|
<race-name>AC35</race-name>
|
||||||
<race-size>6</race-size>
|
<race-size>6</race-size>
|
||||||
<time-scale>1.0</time-scale>
|
<time-scale>10.0</time-scale>
|
||||||
<wind-direction>135</wind-direction>
|
<wind-direction>135</wind-direction>
|
||||||
</configurations>
|
</configurations>
|
||||||
|
|
||||||
|
|||||||
@@ -4,31 +4,31 @@
|
|||||||
<team>
|
<team>
|
||||||
<name>Oracle Team USA</name>
|
<name>Oracle Team USA</name>
|
||||||
<alias>USA</alias>
|
<alias>USA</alias>
|
||||||
<velocity>1</velocity>
|
<velocity>12.9</velocity>
|
||||||
</team>
|
</team>
|
||||||
<team>
|
<team>
|
||||||
<name>Artemis Racing</name>
|
<name>Artemis Racing</name>
|
||||||
<alias>ART</alias>
|
<alias>ART</alias>
|
||||||
<velocity>1.1</velocity>
|
<velocity>13.1</velocity>
|
||||||
</team>
|
</team>
|
||||||
<team>
|
<team>
|
||||||
<name>Emirates Team New Zealand</name>
|
<name>Emirates Team New Zealand</name>
|
||||||
<alias>NZL</alias>
|
<alias>NZL</alias>
|
||||||
<velocity>2</velocity>
|
<velocity>15.6</velocity>
|
||||||
</team>
|
</team>
|
||||||
<team>
|
<team>
|
||||||
<name>Land Rover BAR</name>
|
<name>Land Rover BAR</name>
|
||||||
<alias>BAR</alias>
|
<alias>BAR</alias>
|
||||||
<velocity>1.3</velocity>
|
<velocity>13.3</velocity>
|
||||||
</team>
|
</team>
|
||||||
<team>
|
<team>
|
||||||
<name>SoftBank Team Japan</name>
|
<name>SoftBank Team Japan</name>
|
||||||
<alias>JAP</alias>
|
<alias>JAP</alias>
|
||||||
<velocity>1.7</velocity>
|
<velocity>14.7</velocity>
|
||||||
</team>
|
</team>
|
||||||
<team>
|
<team>
|
||||||
<name>Groupama Team France</name>
|
<name>Groupama Team France</name>
|
||||||
<alias>FRC</alias>
|
<alias>FRC</alias>
|
||||||
<velocity>1.4</velocity>
|
<velocity>11.4</velocity>
|
||||||
</team>
|
</team>
|
||||||
</teams>
|
</teams>
|
||||||
@@ -24,7 +24,7 @@ public class ConfigParserTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTimeScale() throws Exception {
|
public void getTimeScale() throws Exception {
|
||||||
assertEquals(1.0, cp.getTimeScale(), 1e-10);
|
assertEquals(10.0, cp.getTimeScale(), 1e-10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user