mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 10:19:46 +02:00
Kleinere Änderungen
This commit is contained in:
@@ -158,15 +158,14 @@ public class GameLoopD extends JFrame implements Runnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
long lastTime = System.nanoTime();
|
long lastTime = System.nanoTime();
|
||||||
final double fps = 60.0;
|
final double targetTickAmount = 60.0;
|
||||||
double ns = 1000000000 / fps;
|
double ns = 1000000000 / targetTickAmount;
|
||||||
double delta = 0;
|
double delta = 0;
|
||||||
int updates = 0;
|
int updates = 0;
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
long timer = System.currentTimeMillis();
|
long timer = System.currentTimeMillis();
|
||||||
|
|
||||||
while (running) {
|
while (running) {
|
||||||
kb.foo();
|
|
||||||
long now = System.nanoTime();
|
long now = System.nanoTime();
|
||||||
delta += (now-lastTime) / ns;
|
delta += (now-lastTime) / ns;
|
||||||
lastTime = now;
|
lastTime = now;
|
||||||
@@ -190,6 +189,7 @@ public class GameLoopD extends JFrame implements Runnable {
|
|||||||
}
|
}
|
||||||
// alles was geupdatet werden muss hier rein
|
// alles was geupdatet werden muss hier rein
|
||||||
private void tick() {
|
private void tick() {
|
||||||
|
kb.checkKeyActivity();
|
||||||
player01.tick();
|
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 :)
|
* rudimentäre kollisionserkennung, exportiere ich gerade in eigenes modul :)
|
||||||
|
|||||||
Reference in New Issue
Block a user