aboutsummaryrefslogtreecommitdiff
path: root/web/pw-visualizer/src
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-11-19 10:13:13 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-11-19 10:13:13 +0100
commitd0948b54f409d248765c39a44048afb07170edaf (patch)
tree322e11849ea827d127b21b2d987555cfa84ae6ab /web/pw-visualizer/src
parent3f3178d15ab299353c26e447c3e34ea0b94c1169 (diff)
downloadplanetwars.dev-d0948b54f409d248765c39a44048afb07170edaf.tar.xz
planetwars.dev-d0948b54f409d248765c39a44048afb07170edaf.zip
visualizer: ensure matches start rendering at turn 0
Diffstat (limited to 'web/pw-visualizer/src')
-rw-r--r--web/pw-visualizer/src/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/web/pw-visualizer/src/index.ts b/web/pw-visualizer/src/index.ts
index 68a6c2a..322b7d0 100644
--- a/web/pw-visualizer/src/index.ts
+++ b/web/pw-visualizer/src/index.ts
@@ -176,7 +176,7 @@ export class GameInstance {
prev_time: DOMHighResTimeStamp = 0;
- turn: number = -1;
+ turn: number = 0;
// non-discrete part of visualizer time
fractional_game_time: number = 0.0;
@@ -722,6 +722,7 @@ export function start() {
return;
}
_animating = true;
+ game_instance.prev_time = window.performance.now();
requestAnimationFrame(step);
}