LÖVE 11.5 game template

spooki-love

An empty LÖVE (Love2D) game built on a small, self-contained engine. Scaffold a copy, then start adding scenes.

Out of the box you get a Menu scene with a Start button that switches to an empty Game scene, custom cursors, hot reload on save, a dev MCP bridge, and a release script that builds Mac, Windows, web and .love packages and pushes them to itch.io.

Placeholder cover art reading NEW GAME, built with spooki-love
The template renders its own cover, icon, favicon and social images from Lua scenes. This is the placeholder art before you rename it.

Quick start

The wizard asks for the game title, author and itch.io username, then rewrites the window title, wordmarks, release variables, README and changelog. Pass --title, --author, --itch, --uti and --yes to skip the prompts.

Scaffold a new game from a checkout

./init.sh ../my-game

Scaffold without a checkout

curl -fsSL https://raw.githubusercontent.com/spooki-dev/spooki-love/main/init.sh | bash -s my-game

Or clone first and rename in place

git clone https://github.com/spooki-dev/spooki-love.git my-game && cd my-game && ./init.sh

Run it (love is not on PATH on macOS)

/Applications/love.app/Contents/MacOS/love .

Build Mac, Windows, web and .love packages without pushing

scripts/release.sh --no-push

New here? Start with Getting started in the documentation.

Examples

49 small scenes that each show one part of the engine, running in the browser next to their source. The same files are the engine's regression suite, so every feature shown here is tested on every commit.

See all 49 examples

What you get

GameObject system

A base class for every entity: position, sprites and quads, shapes, text, animation, mouse and keyboard events, and children.

Scenes and layers

Scenes own ground, entities and ui layers, a gameObject registry, input dispatch and a camera with zoom and bounds-based culling.

Hot reload and MCP bridge

Saved edits reload the game automatically, backtick forces it, and a dev-only MCP bridge on port 12345 lets tools drive the running game.

UI primitives

UIBox, UICanvas, UIStack, UIText, UIBar, BarFill and Button compose into a hierarchy via children, with fonts looked up by key.

Post-processing shaders

A ping-pong canvas shader chain configured from main.lua. Scenes feed uniforms each frame through a single hook.

Asset export

Icon, favicon, cover, social, wide and logo PNGs are rendered by the game itself from Lua scenes, so a colour or font change regenerates them.

Audio, cursors and caching

Centralised managers for sounds and music, named custom cursors, and preloaded spritesheets, images, fonts and sounds.

Utilities and components

Easing, hex colours, noise and perlin, theta pathfinding, intersection tests, table serialisation, hit and hurt boxes, and a light manager.

One-command release

release.sh exports assets, builds the .love, packages Mac and Windows with the icon baked in, builds the love.js web version and pushes every channel to itch.io with butler.

Engine architecture

main.lua builds the game from a config table and is the only place scenes are registered. The reusable engine lives under engine/ and never requires anything outside it.

FilePurpose
Game.luaTop-level game built from a config table. Owns the managers and wires every love.* callback.
Scene.luaBase scene class managing layers, the gameObject registry, camera and input dispatch.
GameObject.luaBase class for all entities: rendering, animation, events and children.
sceneManager.luaStores scenes by name and delegates update, draw and input to the current one.
Camera.luaPosition, zoom and bounds-based culling.
cacheManager.luaPreloads and caches spritesheets, images, fonts and sounds before they are used.
audioManager.luaLoads and plays sound effects and music.
cursorManager.luaNamed cursor registry populated from the cursors config.
PostProcessing.luaShader chain populated from the shaders config, refilled with uniforms by the current scene each frame.
AssetExporter.luaRenders asset scenes to canvases at exact sizes and writes PNGs when run with --export-assets.
renderer.luaShared drawing utilities used by GameObject.
InputManager.luaInput state tracking.
State.luaGeneric key/value state container; state/GameState.lua is an instance.
ui/UIBox, UICanvas, UIStack, UIText, UIBar, BarFill and Button.
components/Optional mixins: HitHurtBox and LightManager.
utils/Easing, hexcolor, intersection, noise, perlin, theta pathfinding and table serialisation.
lib/Vendored third-party code: rxi/classic, hotReload and the Shädows light engine.
dev/mcp_bridge.luaThe MCP bridge, loaded in dev only.

Contracts a game must honour

  • Font keys. The UI looks up fonts by key: header, subheader, body and small. Preload them in the first scene.
  • Cursor keys. Button switches between the active and default cursors, so provide both in the cursors config.
  • Layer names. ground, entities and ui. The ui layer draws in screen space and UI objects default to it.
  • Preload comes first. Scenes load as they are registered, so Preload must be the first entry in the scenes array.
  • Never edit engine/. Anything the engine needs from the game goes through the Game config table in main.lua or a scene hook.
  • Stay within Lua 5.1. The web build runs on PUC Lua 5.1, not LuaJIT. No goto, ffi or table.unpack. lint-lua51.sh and the pre-commit hook enforce it.