diff --git a/src/main/java/pacmanGame/Program.java b/src/main/java/pacmanGame/Program.java index 274dbe3..cf62472 100644 --- a/src/main/java/pacmanGame/Program.java +++ b/src/main/java/pacmanGame/Program.java @@ -6,6 +6,7 @@ import javax.swing.*; public class Program { + public GameManager gameManager; public MyKeyListener input; public JTextArea textArea; public JFrame frame; @@ -18,9 +19,25 @@ public class Program { public void StartGame() { CreateAndShowGUI(); + gameManager = new GameManager(); + GameLoop(); + + } + + public void GameLoop() { + boolean running = true; + + while(running) { + gameManager.Update(); + + textArea.setText((String)gameManager.visualizer.GetOutput()); + + try { + Thread.sleep(100); + } catch (InterruptedException e) {} + } } - public void CreateAndShowGUI() { frame = new JFrame("PacmaaaAAAYYYHAAAaaam");