love.update(dt)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Ferseus
Prole
Posts: 3
Joined: Fri Oct 17, 2014 10:17 am

love.update(dt)

Post 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!
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: love.update(dt)

Post 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.
Ferseus
Prole
Posts: 3
Joined: Fri Oct 17, 2014 10:17 am

Re: love.update(dt)

Post by Ferseus »

Okay I understand now, thanks for your help!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests