diff --git a/HeatUp/src/de/heatup/testing/GameLoopD.java b/HeatUp/src/de/heatup/testing/GameLoopD.java index d9c460b..5c0a337 100644 --- a/HeatUp/src/de/heatup/testing/GameLoopD.java +++ b/HeatUp/src/de/heatup/testing/GameLoopD.java @@ -179,6 +179,10 @@ public class GameLoopD extends JFrame implements Runnable { } } + public static Player getPlayer() { + return player01; + } + public synchronized void start() { if (running) { return; @@ -221,9 +225,7 @@ public class GameLoopD extends JFrame implements Runnable { delta += (now-lastTime) / ns; lastTime = now; if (delta >= 1) { - if (!pause) { - tick(); - } + tick(); updates++; delta--; } @@ -231,8 +233,7 @@ public class GameLoopD extends JFrame implements Runnable { frames++; try { - thread.sleep(1); // entlastet die cpu massiv. - + thread.sleep(1); // entlastet die cpu massiv. } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -256,26 +257,28 @@ public class GameLoopD extends JFrame implements Runnable { Config.currentTickNr++; } kb.checkKeyActivity(); - ActionWatcher.tick(); - ActionControl.actionControl(); - HardwareResetTimers.tick(); - player01.tick(); - opponent01.tick(); - opponent02.tick(); - opponent03.tick(); - opponent04.tick(); - opponent05.tick(); - opponent06.tick(); - CollisionHandler.tick(); + if (!pause) { + ActionWatcher.tick(); + ActionControl.actionControl(); + HardwareResetTimers.tick(); + player01.tick(); + opponent01.tick(); + opponent02.tick(); + opponent03.tick(); + opponent04.tick(); + opponent05.tick(); + opponent06.tick(); + CollisionHandler.tick(); + } } // alles was animiert wird hier rein (paints) private void render() { - player01.repaint(); - outerPanel.repaint(); - gamePanel.repaint(); - actionPanel.repaint(); - statusPanel.repaint(); - this.repaint(); +// player01.repaint(); +// outerPanel.repaint(); +// gamePanel.repaint(); +// actionPanel.repaint(); +// statusPanel.repaint(); +// this.repaint(); } }