diff --git a/src/main/java/pacmanGame/Program.java b/src/main/java/pacmanGame/Program.java index 734bfc4..e62fa28 100644 --- a/src/main/java/pacmanGame/Program.java +++ b/src/main/java/pacmanGame/Program.java @@ -52,7 +52,7 @@ public class Program { frame = new JFrame("PacmaaaAAAYYYHAAAaaam"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - frame.setSize(500, 665); + frame.setSize(500, 685); textArea = new JTextArea("..."); textArea.setEditable(false); diff --git a/src/main/java/pacmanGame/VisualizerPlainText.java b/src/main/java/pacmanGame/VisualizerPlainText.java index 8559f95..7591711 100644 --- a/src/main/java/pacmanGame/VisualizerPlainText.java +++ b/src/main/java/pacmanGame/VisualizerPlainText.java @@ -3,7 +3,7 @@ package pacmanGame; import java.util.HashMap; public class VisualizerPlainText implements Visualizer { - + public boolean showScore = true; private String output; public final GameManager gameManager; @@ -28,6 +28,9 @@ public class VisualizerPlainText implements Visualizer { @Override public void Update() { output = ""; + if(showScore) { + output = "score: " + gameManager.score + "\n"; + } 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..7227f86 100644 --- a/src/test/java/pacmanTests/VisualizerPlainTextTest.java +++ b/src/test/java/pacmanTests/VisualizerPlainTextTest.java @@ -22,7 +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" + " . \n" @@ -46,6 +46,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);