Merge branch 'boat_color_and_speed' into 'master'
Boat color and speed - Boats are colored by their assigned color. - Boat name is displayed in lobby. - Boats don't move quite so fast. See merge request !50
This commit is contained in:
@@ -91,7 +91,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
|
||||
server.parseSnapshot();
|
||||
|
||||
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 50);
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 16);
|
||||
previousFrameTime = currentTime;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
|
||||
race.setBoatsStatusToRacing();
|
||||
}
|
||||
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 50);
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 16);
|
||||
previousFrameTime = currentTime;
|
||||
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
|
||||
previousFrameTime = currentTime;
|
||||
}
|
||||
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 50);
|
||||
waitForFramePeriod(previousFrameTime, currentTime, 16);
|
||||
previousFrameTime = currentTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Constants {
|
||||
* Frame periods are multiplied by this to get the amount of time a single frame represents.
|
||||
* E.g., frame period = 20ms, scale = 5, frame represents 20 * 5 = 100ms, and so boats are simulated for 100ms, even though only 20ms actually occurred.
|
||||
*/
|
||||
public static final int RaceTimeScale = 10;
|
||||
public static final int RaceTimeScale = 2;
|
||||
|
||||
/**
|
||||
* The race pre-start time, in milliseconds. 30 seconds.
|
||||
|
||||
@@ -15,6 +15,7 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.paint.PhongMaterial;
|
||||
import javafx.scene.shape.MeshView;
|
||||
import mock.app.Event;
|
||||
import network.Messages.Enums.RaceStatusEnum;
|
||||
@@ -144,6 +145,8 @@ public class InGameLobbyController extends Controller {
|
||||
subjects.add(sea);
|
||||
|
||||
MeshView mesh = new MeshView(importer.getImport());
|
||||
PhongMaterial boatColorMat = new PhongMaterial(boat.getColor());
|
||||
mesh.setMaterial(boatColorMat);
|
||||
Subject3D subject = new Subject3D(mesh,0);
|
||||
subjects.add(subject);
|
||||
|
||||
@@ -161,7 +164,7 @@ public class InGameLobbyController extends Controller {
|
||||
};
|
||||
rotate.start();
|
||||
|
||||
allPlayerLabels.get(count).setText("Player: " + boat.getSourceID());
|
||||
allPlayerLabels.get(count).setText(boat.getName());
|
||||
allPlayerLabels.get(count).toFront();
|
||||
count += 1;
|
||||
if (count > 2){
|
||||
|
||||
@@ -305,6 +305,8 @@ public class RaceViewController extends Controller {
|
||||
} else {
|
||||
mesh = new MeshView(importerBurgerBoat.getImport());
|
||||
}
|
||||
PhongMaterial boatColorMat = new PhongMaterial(boat.getColor());
|
||||
mesh.setMaterial(boatColorMat);
|
||||
Subject3D boatModel = new Subject3D(mesh, boat.getSourceID());
|
||||
|
||||
viewSubjects.add(boatModel);
|
||||
|
||||
Reference in New Issue
Block a user