Page 1 of 1

love.update(dt)

Posted: Mon Oct 20, 2014 3:12 pm
by Ferseus
Hi, I'm new to Love2d, and I have 2 questions.
1.Does love.update(dt) HAVE to be called in main.lua?
2. If it doesn't HAVE to then can I call the function love.update(dt) multiple times? like this:

function love.load
end

function love.update(dt)
end

function love.update(dt)
end

function love.draw()
end

--Any help will be appreciated!

Re: love.update(dt)

Posted: Mon Oct 20, 2014 3:51 pm
by micha
No, love.update does not have to be called by you at all. In main.lua you define this function, but love calls it automatically each frame.

If you are interested in how this is done, have a look at the love.run() function.

Re: love.update(dt)

Posted: Mon Oct 20, 2014 8:28 pm
by Ferseus
Okay I understand now, thanks for your help!