mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 12:39:45 +02:00
Kleine Gameloop-Änderung.
Getter für player Objekt hinzugefügt!
This commit is contained in:
@@ -179,6 +179,10 @@ public class GameLoopD extends JFrame implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public static Player getPlayer() {
|
||||
return player01;
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
if (running) {
|
||||
return;
|
||||
@@ -221,9 +225,7 @@ public class GameLoopD extends JFrame implements Runnable {
|
||||
delta += (now-lastTime) / ns;
|
||||
lastTime = now;
|
||||
if (delta >= 1) {
|
||||
if (!pause) {
|
||||
tick();
|
||||
}
|
||||
tick();
|
||||
updates++;
|
||||
delta--;
|
||||
}
|
||||
@@ -231,8 +233,7 @@ public class GameLoopD extends JFrame implements Runnable {
|
||||
frames++;
|
||||
|
||||
try {
|
||||
thread.sleep(1); // entlastet die cpu massiv.
|
||||
|
||||
thread.sleep(1); // entlastet die cpu massiv.
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@@ -256,26 +257,28 @@ public class GameLoopD extends JFrame implements Runnable {
|
||||
Config.currentTickNr++;
|
||||
}
|
||||
kb.checkKeyActivity();
|
||||
ActionWatcher.tick();
|
||||
ActionControl.actionControl();
|
||||
HardwareResetTimers.tick();
|
||||
player01.tick();
|
||||
opponent01.tick();
|
||||
opponent02.tick();
|
||||
opponent03.tick();
|
||||
opponent04.tick();
|
||||
opponent05.tick();
|
||||
opponent06.tick();
|
||||
CollisionHandler.tick();
|
||||
if (!pause) {
|
||||
ActionWatcher.tick();
|
||||
ActionControl.actionControl();
|
||||
HardwareResetTimers.tick();
|
||||
player01.tick();
|
||||
opponent01.tick();
|
||||
opponent02.tick();
|
||||
opponent03.tick();
|
||||
opponent04.tick();
|
||||
opponent05.tick();
|
||||
opponent06.tick();
|
||||
CollisionHandler.tick();
|
||||
}
|
||||
}
|
||||
// alles was animiert wird hier rein (paints)
|
||||
private void render() {
|
||||
player01.repaint();
|
||||
outerPanel.repaint();
|
||||
gamePanel.repaint();
|
||||
actionPanel.repaint();
|
||||
statusPanel.repaint();
|
||||
this.repaint();
|
||||
// player01.repaint();
|
||||
// outerPanel.repaint();
|
||||
// gamePanel.repaint();
|
||||
// actionPanel.repaint();
|
||||
// statusPanel.repaint();
|
||||
// this.repaint();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user