Callbacks
Introduction

Contained within the love module are several callbacks - functions that get called by the LÖVE engine automatically over the course of a game. By default, they do nothing. But if you declare them within your LÖVE project, you can define their behavior.

love.load

This function is called exacly once at the beginning of the game. This is where resources such as images and sounds should be loaded.

love.update

This function should update the state of the game according to the time value dt. This is called once per cycle. There are usually many calls to love.update() in between each love.draw().

love.draw

This is where you should draw things onto the screen. It is called once per frame.

love.keypressed
love.keyreleased
love.mousepressed
love.mousereleased
Copyright © 2006-2009 LÖVE Development Team.