|
|
Callback
update( dt )
This function should update the state of the game according to the time value dt.
Synopsis
function update( dt ) ... end
Arguments
dt
The time since last update in seconds.
Returns
(Nothing)
Examples
Example 51: Basic callbacks
elapsed = 0 -- Load: called when the game -- loads. function load() -- Load a font local f = love.graphics.newFont(love.default_font, 12) love.graphics.setFont(f) end -- Update: Called each frame. Update the -- state of your game here. function update(dt) elapsed = elapsed + dt end -- Draw: Called each frame. The game -- should be drawn in this functions. function draw() love.graphics.draw("Elapsed time: " .. elapsed, 100, 100) end
Copyright © 2006-2008 LÖVE Development Team.
|