Skip to content

Instantly share code, notes, and snippets.

@wilbefast
Last active August 29, 2015 14:01
Show Gist options
  • Save wilbefast/acd9e1ba7d1a3a06dc7e to your computer and use it in GitHub Desktop.
Save wilbefast/acd9e1ba7d1a3a06dc7e to your computer and use it in GitHub Desktop.
Skip updates rather than showing Löve 2D's blue screen of death
local __unsafeUpdate = function()
local dt = math.min(MAX_DT, love.timer.getDelta())
-- do your update here
end
function love.update()
local success, err = xpcall(__unsafeUpdate, debug.traceback) -- use debug.debug for interactive debugging
if not success then
print(err)
end
end
local __unsafeDraw = function()
-- do your drawing here
end
function love.draw()
local success, err = xpcall(__unsafeDraw, debug.traceback) -- use debug.debug for interactive debugging
if not success then
print(err)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment