Changed the spawn point to behind start line and calculated quadrant to make sure yachts spawn behind start line in different map scenario.

#story[1117]
This commit is contained in:
Zhi You Tan
2017-08-07 11:50:07 +12:00
parent a470cb66a2
commit a4b22190c0
@@ -200,6 +200,14 @@ public class MainServerThread extends Observable implements Runnable, ClientConn
GeoPoint spawnMark = GeoUtility GeoPoint spawnMark = GeoUtility
.getGeoCoordinate(midpoint, perpendicularAngle, distanceApart * DISTANCEFACTOR); .getGeoCoordinate(midpoint, perpendicularAngle, distanceApart * DISTANCEFACTOR);
if (yacht.getHeading() < perpendicularAngle) {
spawnMark = GeoUtility
.getGeoCoordinate(spawnMark, perpendicularAngle + 90, DISTANCEFACTOR);
} else {
spawnMark = GeoUtility
.getGeoCoordinate(spawnMark, perpendicularAngle + 270, DISTANCEFACTOR);
}
yacht.setLocation(spawnMark); yacht.setLocation(spawnMark);
boatIndex++; boatIndex++;
} }