The fastest way to start a game: clone something that already runs, then make it yours.
Clone and run (2 min)
git clone https://github.com/findingfocus/love2d-starter.git my-game
cd my-game
love .You get three screens and a loop: title → play → win → play again.
| Action | Key |
|---|---|
| Start / Play again | Enter |
| Win (from play) | W |
| Quit | Esc |
Anatomy
my-game/
main.lua -- Love2D callbacks + state machine wiring (78 lines)
conf.lua -- game title + window size (9 lines)
class.lua -- tiny OOP helper, read it once
StateMachine.lua -- title <-> play <-> win switching
push.lua -- resolution scaling for any window size
states/
BaseState.lua -- empty interface (6 lines)
TitleScreenState.lua -- press enter to start (16 lines)
PlayState.lua -- your gameplay goes here (16 lines)
WinState.lua -- press enter to replay (16 lines)
NOTE
push.lua,class.lua, andStateMachine.luaare helpers — you don’t need to understand them fully to use them. Read them once, treat them as black boxes, and build instates/.
How to make it yours (10 min)
- Change the title + window size in
conf.lua - Put your gameplay in
states/PlayState.lua(updatemoves things,renderdraws them) - Reskin
states/TitleScreenState.luaandstates/WinState.lua - Ship it: Distribution
Full guidance lives in the repo’s README.md.
Study the full example (BTTF)
The BTTF demo was built on this exact pattern, extended with a speedometer, obstacles, crash audio, and touch zones. Browse it annotated here:
- main.lua — the whole wiring
- StateMachine.lua
- Delorean.lua — a player entity
- PlayState.lua — gameplay
- TitleScreenState.lua — title
- BaseState.lua
- class.lua + push.lua — helper libraries, originals linked above
Full file tree + download: BTTF project page.
Next step