diff --git a/bin/Game.class b/bin/Game.class index e00d096..65111ec 100644 Binary files a/bin/Game.class and b/bin/Game.class differ diff --git a/src/Game.java b/src/Game.java index 949764e..7646427 100644 --- a/src/Game.java +++ b/src/Game.java @@ -29,7 +29,7 @@ public class Game { private JLabel fpsLabel; private JLabel liveLabels[]; - private long delaytimer = 4000; + private int delaytimer = 4; @SuppressWarnings("unused") private long fps = 60; @@ -457,24 +457,25 @@ public class Game { fps = 1000000000 / dt; // Berechnen der fps if (frames > 100) { if (fps > 200) { - delaytimer += 100; + delaytimer++; } else if (fps < 180) { - delaytimer -= 100; + delaytimer--; } } } delay(delaytimer); // delay ist wichtig, um die geschwindigkeit der objekte und die fps zu // kontrollieren + System.out.println(delaytimer); } // ENDE DES MAIN-LOOPS } // Methode zum verzögern (warten) in ms - public void delay(long time) { + public void delay(int time) { try { - Thread.sleep(0, (int) time); + Thread.sleep(time); } catch (InterruptedException e) { e.printStackTrace(); }