[Solved] Exit love.keypressed() function
Posted: Mon Aug 06, 2018 12:18 am
Can anyone explain why this doesn't work?
The problem is that the line with "return", should exit the function, and not process any other code when triggered. But even if console.active = true, then everything else gets run afterwards.
Code: Select all
function love.keypressed(key)
if console.active then
console:keypressed(key)
return -- <---should exit function here
end
player:keypressed(key)
--[[
other code etc.... than should only be run when console.active = false
--]]
end