Hi Stout! I'm just going by your first post, where you said that the following doesn't work:
stout wrote:
Code: Select all
function love.keypressed(key)
titleKeys()
end
function titleKeys()
if key == "n" then
view = "map"
end
end
I'm not sure if this is still relevant, but it is very possible! Just pass the "key" variable to the new function! Here's a short example:
Code: Select all
view = "normal"
function love.keypressed(key)
titleKeys(key)
end
function titleKeys(key)
if key == "n" then
view = "map"
end
end
function love.draw()
if view == "map" then
love.graphics.print("WHAT, THE MAP IS OPEN!!!", 10, 10)
elseif view == "normal" then
love.graphics.print("Press the n key, babe.", 10, 10)
end
end
If this doesn't help you at all, sorry! But reading that forced me to go test it right away.
Hope you find your answer!