From e4f9d50a553f6ebd46e5505d46edbd945e821ae7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 13 Jul 2022 09:31:54 -0700 Subject: a more radical attempt at ignoring nil y's --- app.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app.lua') diff --git a/app.lua b/app.lua index 2655ea0..ff6a7de 100644 --- a/app.lua +++ b/app.lua @@ -35,9 +35,7 @@ function love.run() end end - if love.timer then dt = love.timer.step() end - - if App.update then App.update(dt) end -- will pass 0 if love.timer is disabled + -- perform draw before update to give it a chance to mutate state if love.graphics and love.graphics.isActive() then love.graphics.origin() @@ -48,6 +46,10 @@ function love.run() love.graphics.present() end + if love.timer then dt = love.timer.step() end + + if App.update then App.update(dt) end -- will pass 0 if love.timer is disabled + if love.timer then love.timer.sleep(0.001) end end end -- cgit 1.4.1-2-gfad0