<span>Change Log</span>
</h2>
<ul>
+ <li>
+ Don't destroy the castle if the troll doesn't reach it.
+ </li>
+ <li>
+ Ensure proper troll movement direction in all cases of
+ cheating.
+ </li>
<li>
Fixed the road length fencepost non-issue.
</li>
if (model.haveWinner()) {
int loser = model.getLoser();
gameManager.addToGameSummary(GameManager.formatErrorMessage("Troll destroys " + gameManager.getPlayer(loser).getNicknameToken()) + ".");
+ gameManager.getPlayer(loser).view.destroy();
victory = true;
}
else if (model.exhausted()) exhausted = true;
if (s0 > s1) {
gameManager.addToGameSummary(GameManager.formatSuccessMessage(p0.getNicknameToken() + " wins."));
- p1.view.destroy();
+ p1.view.markLoser();
}
else if (s0 < s1) {
gameManager.addToGameSummary(GameManager.formatSuccessMessage(p1.getNicknameToken() + " wins."));
- p0.view.destroy();
+ p0.view.markLoser();
}
else if (s0 < 0) {
gameManager.addToGameSummary(GameManager.formatErrorMessage("Everybody loses!"));
- p0.view.destroy();
- p1.view.destroy();
+ p0.view.markLoser();
+ p1.view.markLoser();
}
else {
gameManager.addToGameSummary("Draw.");
graphicEntityModule.commitEntityState(0, message);
}
- void destroy() {
+ void markLoser() {
graphicEntityModule.commitEntityState(0.5, avatar);
int dir = random.nextInt(2) == 1 ? 1 : -1;
avatar.setRotation(dir * 170 * Math.PI / 180, Curve.ELASTIC);
+ }
+ void destroy() {
graphicEntityModule.commitEntityState(0.5, castle);
castle.setX(castle.getX(), Curve.ELASTIC);
castle.setScaleY(-0.2, Curve.EASE_IN);