From cf6cb9ad675540769af1589a6f5d0f4d4cf65dab Mon Sep 17 00:00:00 2001 From: toksikk Date: Thu, 6 Nov 2014 20:55:15 +0100 Subject: [PATCH] =?UTF-8?q?Kleinere=20=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HeatUp/src/de/heatup/testing/GameLoopD.java | 6 +++--- HeatUp/src/de/heatup/ui/KeyBindings.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/HeatUp/src/de/heatup/testing/GameLoopD.java b/HeatUp/src/de/heatup/testing/GameLoopD.java index 61f566e..c2fef74 100644 --- a/HeatUp/src/de/heatup/testing/GameLoopD.java +++ b/HeatUp/src/de/heatup/testing/GameLoopD.java @@ -158,15 +158,14 @@ public class GameLoopD extends JFrame implements Runnable { public void run() { long lastTime = System.nanoTime(); - final double fps = 60.0; - double ns = 1000000000 / fps; + final double targetTickAmount = 60.0; + double ns = 1000000000 / targetTickAmount; double delta = 0; int updates = 0; int frames = 0; long timer = System.currentTimeMillis(); while (running) { - kb.foo(); long now = System.nanoTime(); delta += (now-lastTime) / ns; lastTime = now; @@ -190,6 +189,7 @@ public class GameLoopD extends JFrame implements Runnable { } // alles was geupdatet werden muss hier rein private void tick() { + kb.checkKeyActivity(); player01.tick(); } diff --git a/HeatUp/src/de/heatup/ui/KeyBindings.java b/HeatUp/src/de/heatup/ui/KeyBindings.java index 36de76e..7cf3435 100644 --- a/HeatUp/src/de/heatup/ui/KeyBindings.java +++ b/HeatUp/src/de/heatup/ui/KeyBindings.java @@ -56,7 +56,7 @@ public class KeyBindings extends KeyAdapter { } } - public void foo() { + public void checkKeyActivity() { /* * rudimentäre kollisionserkennung, exportiere ich gerade in eigenes modul :)