From 5724f1dc25787e82fd25c3c208896f22fdeffa58 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 24 Nov 2018 18:44:45 +0100 Subject: Call Game.update() on Scene loop --- src/subconscious/Game.java | 8 +++++++- src/subconscious/graphics/Scene.java | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/subconscious/Game.java b/src/subconscious/Game.java index 5c3d7d0..6f14def 100644 --- a/src/subconscious/Game.java +++ b/src/subconscious/Game.java @@ -56,7 +56,13 @@ public class Game { this.setState(State.BATTLE); } - public void update() { + public void update(long deltaNanoTime) { + // TODO: debug, disable on "release" + // System.out.println("Game update from : " + // + Thread.currentThread().getStackTrace()[2].getClassName() + " " + // + Thread.currentThread().getStackTrace()[2].getMethodName() + " " + // + Thread.currentThread().getStackTrace()[2].getFileName() + " " + // ); } diff --git a/src/subconscious/graphics/Scene.java b/src/subconscious/graphics/Scene.java index 113a46f..7e67490 100644 --- a/src/subconscious/graphics/Scene.java +++ b/src/subconscious/graphics/Scene.java @@ -209,6 +209,7 @@ public abstract class Scene extends Panel // TODO: change to this.game.update(...) this.update(currentUpdateTime - lastUpdateTime); + this.game.update(currentUpdateTime - lastUpdateTime); endLoopTime = System.nanoTime(); deltaLoop = endLoopTime - beginLoopTime; -- cgit v1.2.1