Spooky ghosts of dead bugs!
Congrats slime and bartbes!
If anyone else thought "why would you need love.event.quit("restart") instead of calling love.load() or whatever?", I certainly don't have the definitive answer, but what I came up with was: A quick way to reset a game where there might be stuff declared outside of love.load, and it also resets internal LOVE/Lua state.
For example, calling love.load() would do nothing to reset the number declared outside of love.load or clear the global Image created outside of love.load or reset the background color.
Code: Select all
local number = 0
function love.keypressed()
number = number + 1
image = love.graphics.newImage('image.png')
love.graphics.setBackgroundColor(255, 255, 255)
end
I'm probably missing other things here.
And if anyone else thought "why is it love.event.quit("restart") instead of love.event.restart() or something, why is restarting a variant of quitting?":
love.event.quit takes an exit status as an argument (which is the number that LOVE returns to the command line once it finishes, and it defaults to 0 which typically means "this program didn't error", I think).
This exit status is returned from love.run. If love.run returns "restart" then the game is restarted instead of quit.
So just like love.event.quit(1) is a shortcut to love.event.push('quit', 1), love.event.quit('restart') is a shortcut to love.event.push('quit', 'restart').
So, if there was a convenience function for restarting, there would be
three ways of restarting (love.event.restart(), love.event.quit('restart'), and love.event.push('quit', 'restart').
I guess lovec.exe means that the t.console setting can be removed in the next backwards-compatibility-breaking release?