Code: Select all
function love.update()
if love.keyboard.isDown("space") and issplash == true then
issplash = false
end
end
function love.draw()
if issplash == true then
--draw the splash screen
else
--draw the level
end
end
Edit: You see, usually there are a lot of booleans like this in my games. Like isfinished, isdead, islevelup, etc. I'm an old time programmer, but don't know lua enough to code well.
Edit: I think I can make a gamestate variable and check its value, I can't think of anything better. It wouldn't shorten the code for sure, but it would be more readable I guess.