diff --git a/HeatUp/src/de/heatup/cfg/Config.java b/HeatUp/src/de/heatup/cfg/Config.java index 439c9f5..7f888c8 100644 --- a/HeatUp/src/de/heatup/cfg/Config.java +++ b/HeatUp/src/de/heatup/cfg/Config.java @@ -4,6 +4,11 @@ package de.heatup.cfg; * Bitte hier eure Magicnumbers eintragen */ public class Config { + /* + * Attribute + * de.heatup.ui.GameLoop + */ + public static int currentTickNr = 0; /* * Attribute * de.heatup.mapengine.* diff --git a/HeatUp/src/de/heatup/mapengine/CollisionHandler.java b/HeatUp/src/de/heatup/mapengine/CollisionHandler.java index 6132a7f..b8ecfd6 100644 --- a/HeatUp/src/de/heatup/mapengine/CollisionHandler.java +++ b/HeatUp/src/de/heatup/mapengine/CollisionHandler.java @@ -65,9 +65,7 @@ public class CollisionHandler { public static void tick() { for (int i=1; i= 1) { - tick(); + if (!pause) { + tick(); + } updates++; delta--; } @@ -192,7 +227,7 @@ public class GameLoopD extends JFrame implements Runnable { frames++; try { - thread.sleep(10); // entlastet die cpu massiv. + thread.sleep(1); // entlastet die cpu massiv. } catch (InterruptedException e) { // TODO Auto-generated catch block @@ -211,11 +246,19 @@ public class GameLoopD extends JFrame implements Runnable { } // alles was geupdatet werden muss hier rein private void tick() { + if (Config.currentTickNr >= 60) { + Config.currentTickNr = 0; + } else { + Config.currentTickNr++; + } kb.checkKeyActivity(); player01.tick(); opponent01.tick(); opponent02.tick(); opponent03.tick(); + opponent04.tick(); + opponent05.tick(); + opponent06.tick(); CollisionHandler.tick(); } // alles was animiert wird hier rein (paints)