The LOVE Game Loop
load, update, and draw.
What Is LÖVE?
LÖVE (also written love2d) is a free framework that lets you build 2D games in pure Lua. You write callback functions and the engine calls them for you.
A LÖVE game lives in a folder with a main.lua file. You run it with love . from that folder, and the engine boots a window and starts the loop.
The Three Core Callbacks
LÖVE drives your game through three callbacks you define in main.lua: love.load, love.update, and love.draw.
You do not call them yourself. The engine calls love.load once, then repeats love.update and love.draw every frame for as long as the game runs.
function love.load() end
function love.update(dt) end
function love.draw() endAll lessons in this course
- The LOVE Game Loop
- Drawing Shapes and Images
- Handling Input
- Movement and Collisions