mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 12:29:44 +02:00
Kleinere Änderungen
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class KeyBindings extends KeyAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
public void foo() {
|
||||
public void checkKeyActivity() {
|
||||
|
||||
/*
|
||||
* rudimentäre kollisionserkennung, exportiere ich gerade in eigenes modul :)
|
||||
|
||||
Reference in New Issue
Block a user