From bae3f9d780e051741a78572e5d38f2dbc4fb5a08 Mon Sep 17 00:00:00 2001 From: Igor Talankin Date: Sat, 4 Apr 2020 13:18:25 +0500 Subject: [PATCH] Fix game time counting --- app/src/debug/java/com/italankin/fifteen/GameManager.java | 2 +- app/src/release/java/com/italankin/fifteen/GameManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/debug/java/com/italankin/fifteen/GameManager.java b/app/src/debug/java/com/italankin/fifteen/GameManager.java index 1102a3c..e27d5f3 100644 --- a/app/src/debug/java/com/italankin/fifteen/GameManager.java +++ b/app/src/debug/java/com/italankin/fifteen/GameManager.java @@ -34,8 +34,8 @@ public void run() { mSurfaceHolder.unlockCanvasAndPost(canvas); } } - elapsed = System.currentTimeMillis() - startTime; delay(); + elapsed = System.currentTimeMillis() - startTime; timeBuffer += elapsed; frameBuffer += 1.0f; if (timeBuffer > 1000) { diff --git a/app/src/release/java/com/italankin/fifteen/GameManager.java b/app/src/release/java/com/italankin/fifteen/GameManager.java index 1acee34..2c70ef9 100644 --- a/app/src/release/java/com/italankin/fifteen/GameManager.java +++ b/app/src/release/java/com/italankin/fifteen/GameManager.java @@ -28,8 +28,8 @@ public void run() { mSurfaceHolder.unlockCanvasAndPost(canvas); } } - elapsed = System.currentTimeMillis() - startTime; delay(); + elapsed = System.currentTimeMillis() - startTime; } }