Last active
August 29, 2015 14:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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