Code can look like this:
Code: Select all
curr = 1
function love.draw()
love.graphics.draw(backgrounds[curr])
end
function love.keypressed(key)
if key == "q" then
curr = 2
else
Code: Select all
curr = 1
function love.draw()
love.graphics.draw(backgrounds[curr])
end
function love.keypressed(key)
if key == "q" then
curr = 2
else
How? Isn't it a contradiction?Positive07 wrote: ... compiles both cases to the same byte code ... the later could even be faster...