love.update

Callback function used to update the state of the game every frame.

Function

Synopsis

love.update( dt )

Arguments

number dt
Time since the last update in seconds.

Returns

Nothing.

Examples

Run a function called think inside a table called npc approximately once per second.

dtotal = 0
function love.update(dt)
  dtotal = dtotal + dt
  if dtotal > 1 then
    dtotal = dtotal - 1
    npc.think()
  end
end

See Also


Other Languages