love.keypressed
Posted: Thu Jan 03, 2013 10:22 am
Hello. I have a question about LÖVE/Lua.
I'm not sure I understand how functions work in Lua.
Let me explain more:
In my main.lua file I have
There is another file "Card.lua" where I have:
I defined the function love.keypressed inside another function in another file. How does that work?
Why does this function overwrites the same function at "main.lua"
Thanks
I'm not sure I understand how functions work in Lua.
Let me explain more:
In my main.lua file I have
Code: Select all
function love.update(dt) end
function love.draw() end
function love.keypressed(k,u) end
Code: Select all
function Card:draw() end
function Card:update(dt)
if bla-bla then
bla-bla
end
function love.keypressed(k,u)
if (bla) then bla end
end
end
Why does this function overwrites the same function at "main.lua"
Thanks