Started trying to get the zoomed in gave view to follow the boat.

Can easily make the boat stay put at the origin. can make it perfectly center, also weary of the weird jittery effect that is present when tracking. Tracking is active when the zoom scale is greater than 1.

#story[1121]
This commit is contained in:
Kusal Ekanayake
2017-08-13 17:02:35 +12:00
parent 2c5fddb695
commit 8ec6490627
2 changed files with 26 additions and 8 deletions
@@ -215,6 +215,7 @@ public class GameClient {
* Updates the position of a boat. Boat and position are given in the provided data.
*/
private void updatePosition(PositionUpdateData positionData) {
raceView.getGameView().trackBoat();
if (positionData.getType() == DeviceType.YACHT_TYPE) {
if (allXMLReceived() && allBoatsMap.containsKey(positionData.getDeviceId())) {
Yacht yacht = allBoatsMap.get(positionData.getDeviceId());
@@ -306,11 +307,9 @@ public class GameClient {
//TODO Allow a zoom in and zoom out methods
case Z: // zoom in
raceView.getGameView().zoomIn();
System.out.println("Zoom in");
break;
case X: // zoom out
raceView.getGameView().zoomOut();
System.out.println("Zoom out");
break;
}
}