From fb6f77b72cafe99c5e6d4d2b8d8f1a43811ad80d Mon Sep 17 00:00:00 2001 From: Matt Low Date: Thu, 16 Jan 2020 16:53:10 +0400 Subject: [PATCH] Alter positioning on high score screens Fix removal of preNewGame() after GameOver --- core/src/com/me/pacman/state/HighScoreEntryState.java | 5 ++--- core/src/com/me/pacman/state/HighScoresState.java | 4 ++-- core/src/com/me/pacman/state/PlayState.java | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/com/me/pacman/state/HighScoreEntryState.java b/core/src/com/me/pacman/state/HighScoreEntryState.java index 456b835..418e2bb 100644 --- a/core/src/com/me/pacman/state/HighScoreEntryState.java +++ b/core/src/com/me/pacman/state/HighScoreEntryState.java @@ -43,8 +43,7 @@ public class HighScoreEntryState extends State { game.fontRenderer.draw(game.batch, "high scores", (8 * 8) + 4, 25 * 8); game.fontRenderer.setColor(Color.CHARTREUSE); - game.fontRenderer.draw(game.batch, "score name", (8 * 8) + 4, 23 * 8); - + game.fontRenderer.draw(game.batch, "score name", (8 * 8) + 4, 22 * 8); game.fontRenderer.setColor(Color.BLUE); game.fontRenderer.draw(game.batch, "" + score.score, (8 * 8) + 4, 18 * 9); @@ -56,7 +55,7 @@ public class HighScoreEntryState extends State { Score[] scores = game.highScores.getHighScores(9); for (int i = 0; i < scores.length; i++) { Score score = scores[i]; - game.fontRenderer.draw(game.batch, String.format("%-8d%s", score.score, score.scorer), (8 * 8) + 4, (16 - i) * 9); + game.fontRenderer.draw(game.batch, String.format("%-8d%s", score.score, score.scorer), (8 * 8) + 4, (17 - i) * 9); } } diff --git a/core/src/com/me/pacman/state/HighScoresState.java b/core/src/com/me/pacman/state/HighScoresState.java index d61087a..bd93087 100644 --- a/core/src/com/me/pacman/state/HighScoresState.java +++ b/core/src/com/me/pacman/state/HighScoresState.java @@ -31,13 +31,13 @@ public class HighScoresState extends State { game.fontRenderer.draw(game.batch, "high scores", (8 * 8) + 4, 25 * 8); game.fontRenderer.setColor(Color.CHARTREUSE); - game.fontRenderer.draw(game.batch, "score name", (8 * 8) + 4, 23 * 8); + game.fontRenderer.draw(game.batch, "score name", (8 * 8) + 4, 22 * 8); game.fontRenderer.setColor(Color.WHITE); Score[] scores = game.highScores.getHighScores(10); for (int i = 0; i < scores.length; i++) { Score score = scores[i]; - game.fontRenderer.draw(game.batch, String.format("%-8d%s", score.score, score.scorer), (8 * 8) + 4, (17 - i) * 9); + game.fontRenderer.draw(game.batch, String.format("%-8d%s", score.score, score.scorer), (8 * 8) + 4, (18 - i) * 9); } } diff --git a/core/src/com/me/pacman/state/PlayState.java b/core/src/com/me/pacman/state/PlayState.java index 8082c1c..d984fc0 100644 --- a/core/src/com/me/pacman/state/PlayState.java +++ b/core/src/com/me/pacman/state/PlayState.java @@ -252,6 +252,7 @@ public class PlayState extends LevelState { game.setNextState(new HighScoreEntryState(game, new Score("aaa", score))); return null; } + preNewGame(); return GameState.PRE_NEW_GAME; case GHOST_CAUGHT_POINTS_WAIT: updateBackgroundAudio();