diff --git a/src/main/java/pacmanGame/Program.java b/src/main/java/pacmanGame/Program.java index 6352548..734bfc4 100644 --- a/src/main/java/pacmanGame/Program.java +++ b/src/main/java/pacmanGame/Program.java @@ -29,10 +29,7 @@ public class Program { boolean running = true; while(running) { - for (char inputChar : input.inputList) { - gameManager.ProcessInput(inputChar); - } - input.inputList.clear(); + ForwardInputToGameManager(); gameManager.Update(); @@ -44,6 +41,13 @@ public class Program { } } + public void ForwardInputToGameManager() { + for (char inputChar : input.inputList) { + gameManager.ProcessInput(inputChar); + } + input.inputList.clear(); + } + public void CreateAndShowGUI() { frame = new JFrame("PacmaaaAAAYYYHAAAaaam"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);