There are eight basic types in Lua:
- nil
- boolean
- number
- string
- function
- userdata
- thread
- table
-- Load some default values for our rectangle. function love.load() --[LOAD] x, y, w, h = 20, 20, 60, 20 end -- Increase the size of the rectangle every frame. function love.update(dt) --[UPDATE] w = w + 1 h = h + 1 end -- Draw a coloured rectangle. function love.draw() --[DRAW] -- In versions prior to 11.0, color component values are (0, 102, 102) love.graphics.setColor(0, 0.4, 0.4) love.graphics.rectangle("fill", x, y, w, h) end
- love.load = This function is called exactly once at the beginning of the game.
love.load( arg, unfilteredArg )
table arg -Command-line arguments given to the game
- love.update = Callback function used to update the state of the game every frame.
love.update( dt )
number dt -Time since the last update in seconds.
- love.draw = Callback function used to draw on the screen every frame.
love.draw( )
No Arguments
- love.graphics = Drawing of shapes and images, management of screen geometry.
- love.run = The main function, containing the main loop. A sensible default is used when left out.
mainLoop = love.run ( )