Rather than a high frequency loop sending all packets a low frequency loop is made then destroyed on button press for sending turn packets. This means a fast response time on button press but fewer packets sent.

#implement #issue[38]
This commit is contained in:
Calum
2017-08-13 18:38:24 +12:00
parent 30a6cb98ec
commit 2093e79b6a
11 changed files with 95 additions and 78 deletions
@@ -492,7 +492,6 @@ public class GameView extends Pane {
distanceFromReference = GeoUtility.getDistance(
minLatPoint, new GeoPoint(unscaledLat, unscaledLon)
);
// System.out.println("distanceFromReference = " + distanceFromReference);
if (angleFromReference >= 0 && angleFromReference <= Math.PI / 2) {
xAxisLocation += Math.round(distanceScaleFactor * Math.sin(angleFromReference) * distanceFromReference);
yAxisLocation -= Math.round(distanceScaleFactor * Math.cos(angleFromReference) * distanceFromReference);
@@ -512,8 +511,6 @@ public class GameView extends Pane {
if(horizontalInversion) {
xAxisLocation = canvasWidth - bufferSize - (xAxisLocation - bufferSize);
}
// System.out.println("yAxisLocation = " + yAxisLocation + " " + unscaledLat);
// System.out.println("xAxisLocation = " + xAxisLocation + " " + unscaledLon);
return new Point2D(xAxisLocation, yAxisLocation);
}