mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed WindWalker
#story[1293]
This commit is contained in:
@@ -81,6 +81,7 @@ public class GameState implements Runnable {
|
|||||||
private static final Integer VELOCITY_BOOST_MULTIPLIER = 2;
|
private static final Integer VELOCITY_BOOST_MULTIPLIER = 2;
|
||||||
private static final Integer HANDLING_BOOST_MULTIPLIER = 2;
|
private static final Integer HANDLING_BOOST_MULTIPLIER = 2;
|
||||||
public static final Long BUMPER_DISABLE_TIME = 5_000L;
|
public static final Long BUMPER_DISABLE_TIME = 5_000L;
|
||||||
|
private static final Long TOKEN_SPAWN_TIME = 15_000L;
|
||||||
|
|
||||||
private static Long previousUpdateTime;
|
private static Long previousUpdateTime;
|
||||||
public static Double windDirection;
|
public static Double windDirection;
|
||||||
@@ -297,7 +298,7 @@ public class GameState implements Runnable {
|
|||||||
spawnNewToken();
|
spawnNewToken();
|
||||||
notifyMessageListeners(MessageFactory.getRaceXML());
|
notifyMessageListeners(MessageFactory.getRaceXML());
|
||||||
}
|
}
|
||||||
}, 0, 15_000);
|
}, 0, TOKEN_SPAWN_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 29/08/17 wmu16 - This sort of update should be in game state
|
// TODO: 29/08/17 wmu16 - This sort of update should be in game state
|
||||||
@@ -382,7 +383,7 @@ public class GameState implements Runnable {
|
|||||||
//Get a random token location with random type
|
//Get a random token location with random type
|
||||||
Token token = allTokens.get(random.nextInt(allTokens.size()));
|
Token token = allTokens.get(random.nextInt(allTokens.size()));
|
||||||
token.assignRandomType();
|
token.assignRandomType();
|
||||||
// token.assignType(TokenType.BUMPER);
|
token.assignType(TokenType.WIND_WALKER);
|
||||||
|
|
||||||
logger.debug("Spawned token of type " + token.getTokenType());
|
logger.debug("Spawned token of type " + token.getTokenType());
|
||||||
|
|
||||||
@@ -508,21 +509,7 @@ public class GameState implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Double heading = yacht.getHeading();
|
Double heading = yacht.getHeading();
|
||||||
if (heading < windDirection) {
|
windDirection = (double) Math.floorMod(Math.round(heading + optimalAngle), 360L);
|
||||||
Double diff = Math.abs(optimalAngle - (windDirection - heading));
|
|
||||||
if (windDirection - heading < optimalAngle) {
|
|
||||||
windDirection = (double) Math.floorMod(Math.round(windDirection + diff), 360L);
|
|
||||||
} else {
|
|
||||||
windDirection = (double) Math.floorMod(Math.round(windDirection - diff), 360L);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Double diff = Math.abs(optimalAngle - (heading - windDirection));
|
|
||||||
if (heading - windDirection < optimalAngle) {
|
|
||||||
windDirection = (double) Math.floorMod(Math.round(windDirection - diff), 360L);
|
|
||||||
} else {
|
|
||||||
windDirection = (double) Math.floorMod(Math.round(windDirection + diff), 360L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user