LÖVE is a framework you can use to make 2D games in Lua. It’s free, open-source, and works on Windows, macOS, Linux, Android and iOS.
Community and Links
Examples
Hello World
This is the full source for ‘hello world’ in LÖVE. Running this code will cause an 800 by 600 window to appear, and display white text on a black background:
Draw an Image
Play a Sound
Functions
love.load()
This function is called at the beginning and it’s supposed to load all your data and variables.
love.update
This function runs repeatedly during the session. The variable dt
is used to update your data, as it marks the time passed since it last ran.
love.draw
Like love.update
, this function is also called continuously, but rather than calculate the values, it draws game elements on the screen.
The value being printed score would constantly be redrawn, but since we are also updating the value of it in the update function, on every redraw we would get the most updated value.
Beyond the Basics
Movement
Drawing Elements
Drawing an Image
License
LÖVE is licensed under the liberal zlib/libpng license. This means that:
- It costs nothing.
- You can use it freely for commercial purposes with no limitations.
The source can be found on GitHub.