From 8a82575121fdde1f891c754411abaa4872a144c9 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 29 Dec 2024 17:32:34 -0500 Subject: * --- html/isometric-bounce/js/game.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'html/isometric-bounce/js') diff --git a/html/isometric-bounce/js/game.js b/html/isometric-bounce/js/game.js index 853763e..a1849c8 100644 --- a/html/isometric-bounce/js/game.js +++ b/html/isometric-bounce/js/game.js @@ -267,10 +267,9 @@ function createGame() { } function gameLoop(timestamp) { - // Set target frame duration for 60 FPS (approximately 16.67ms) + const frameInterval = 1000 / 60; - // If we haven't stored the last frame time, or enough time has passed if (!state.lastFrameTime || timestamp - state.lastFrameTime >= frameInterval) { state.ctx.clearRect(0, 0, state.canvas.width, state.canvas.height); -- cgit 1.4.1-2-gfad0