diff --git a/src/main/java/pacmanGame/VisualizerPlainText.java b/src/main/java/pacmanGame/VisualizerPlainText.java index 37f7768..9bcc354 100644 --- a/src/main/java/pacmanGame/VisualizerPlainText.java +++ b/src/main/java/pacmanGame/VisualizerPlainText.java @@ -6,6 +6,7 @@ public class VisualizerPlainText implements Visualizer { private String output; public final GameManager gameManager; + public boolean showScore = true; public HashMap sprites = new HashMap(){{ this.put("empty", " "); @@ -28,7 +29,13 @@ public class VisualizerPlainText implements Visualizer { @Override public void Update() { - output = "Score: " + gameManager.score + "\n"; + if(showScore) { + output = "Score: " + gameManager.score + "\n"; + } + else { + output = ""; + } + Map map = gameManager.map; for(int y = 0; y < map.size.y; y++) { diff --git a/src/test/java/pacmanTests/VisualizerPlainTextTest.java b/src/test/java/pacmanTests/VisualizerPlainTextTest.java index e73225c..8979476 100644 --- a/src/test/java/pacmanTests/VisualizerPlainTextTest.java +++ b/src/test/java/pacmanTests/VisualizerPlainTextTest.java @@ -22,6 +22,7 @@ class VisualizerPlainTextTest { GameManager gameManager = new GameManager(); gameManager.map = new Map(mapTest, gameManager); VisualizerPlainText vpt = new VisualizerPlainText(gameManager); + vpt.showScore = false; String expected = "" + "[]. []\n" @@ -46,6 +47,7 @@ class VisualizerPlainTextTest { GameManager gameManager = new GameManager(); gameManager.map = new Map(mapTest, gameManager); VisualizerPlainText vpt = new VisualizerPlainText(gameManager); + vpt.showScore = false; gameManager.ghosts[0].position = new Vector2(1, 1);