Kleine Gameloop-Änderung.

Getter für player Objekt hinzugefügt!
This commit is contained in:
toksikk
2014-11-14 10:43:12 +01:00
parent cd05149ede
commit bb2f63277e
+12 -9
View File
@@ -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();
}
updates++;
delta--;
}
@@ -232,7 +234,6 @@ public class GameLoopD extends JFrame implements Runnable {
try {
thread.sleep(1); // entlastet die cpu massiv.
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -256,6 +257,7 @@ public class GameLoopD extends JFrame implements Runnable {
Config.currentTickNr++;
}
kb.checkKeyActivity();
if (!pause) {
ActionWatcher.tick();
ActionControl.actionControl();
HardwareResetTimers.tick();
@@ -268,14 +270,15 @@ public class GameLoopD extends JFrame implements Runnable {
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();
}
}