Fixed merge errors and reimplemented handling multiplier

#story[1274]
This commit is contained in:
Kusal Ekanayake
2017-09-23 15:04:11 +12:00
parent 9112183ac3
commit 364264377a
5 changed files with 22 additions and 17 deletions
@@ -462,17 +462,17 @@ public class GameState implements Runnable {
// TODO: 15/08/17 remove magic numbers from these equations.
if (yacht.getSailIn()) {
if (currentVelocity < maxBoatSpeed - 500) {
yacht.changeVelocity((maxBoatSpeed / 100) * yacht.getAcceleration());
yacht.changeVelocity((maxBoatSpeed / 100) * yacht.getAccelerationMultiplier());
} else if (currentVelocity > maxBoatSpeed + 500) {
yacht.changeVelocity((-currentVelocity / 200) * yacht.getAcceleration());
yacht.changeVelocity((-currentVelocity / 200) * yacht.getAccelerationMultiplier());
} else {
yacht.setCurrentVelocity((maxBoatSpeed) * yacht.getAcceleration());
yacht.setCurrentVelocity((maxBoatSpeed) * yacht.getAccelerationMultiplier());
}
} else {
if (currentVelocity > 3000) {
yacht.changeVelocity((-currentVelocity / 200) * yacht.getAcceleration());
yacht.changeVelocity((-currentVelocity / 200) * yacht.getAccelerationMultiplier());
} else if (currentVelocity > 100) {
yacht.changeVelocity((-currentVelocity / 50) * yacht.getAcceleration());
yacht.changeVelocity((-currentVelocity / 50) * yacht.getAccelerationMultiplier());
} else if (currentVelocity <= 100) {
yacht.setCurrentVelocity(0d);
}