LoveZero is a cross-engine framework inspired by Pygame Zero, designed to run seamlessly on Love2D, Lutro, and Love Potion. It abstracts away boilerplate and engine-specific quirks so you can focus on making games!
- Cross-Engine Compatibility: Automatically detects the underlying engine and hooks into the correct game loop safely.
- Screen Module: Pygame Zero-style drawing primitives (
lz.screen.fill,lz.screen.draw.rect,lz.screen.draw.text). - Clock Module: Easy timers (
schedule_interval,schedule_unique) and smooth tweening animations (animate). - Actor Model: Simple entity management (
lz.Actor) with automatic image loading and AABB collision. - IDE Support: Fully typed via Sumneko LuaLS (
lovezero.luaand.vscodesettings) for robust autocomplete and intellisense.
Drop the lovezero/ folder into your project directory.
Check out the examples/trivial folder for a basic moving box example.
You can run this example using Love2D from the repository root:
love examples/trivialCheck out the examples/nest_trivial_3ds folder for a basic moving box example running with Nest configured to emulate/target a Nintendo 3DS screen.
You can run this example using Love2D from the repository root:
love examples/nest_trivial_3dsCheck out the examples/nest_trivial_switch folder for a basic moving box example running with Nest configured to emulate/target a Nintendo Switch screen.
You can run this example using Love2D from the repository root:
love examples/nest_trivial_switchCheck out the examples/lutro_trivial folder for a basic example running on Lutro (the LÖVE-like libretro core for RetroArch).
To run Lutro, you will need to install RetroArch and the Lutro libretro core. On typical Debian/Ubuntu-based distributions, install them via apt:
sudo apt update
sudo apt install -y retroarch libretro-lutroWe provide a convenient ./lutro executable wrapper script in the repository root that automatically locates the installed Lutro core on your system and launches the target directory:
# Set execute permissions on the wrapper if needed
chmod +x ./lutro
# Run the trivial example with Lutro
./lutro examples/lutro_trivialAlternatively, you can launch RetroArch manually and point it to the Lutro core and main.lua file:
retroarch -L /usr/lib/x86_64-linux-gnu/libretro/lutro_libretro.so examples/lutro_trivial/main.luaNote: Depending on your Linux distribution or installation source, the core might be located at /usr/lib/libretro/lutro_libretro.so or ~/.config/retroarch/cores/lutro_libretro.so.
For automated testing or headless environments, you can run the Lutro wrapper using virtual framebuffer (xvfb-run):
# Install xvfb if not already present
sudo apt install -y xvfb
# Run the example headlessly
xvfb-run -a ./lutro examples/lutro_trivialLoveZero includes a headless pure-Lua test suite to validate internal logic without needing a graphical environment.
# Ensure luajit is installed
chmod +x test.sh
./test.sh- Character assets provided by the amazing Kenney Assets from the New Platformer Pack.
- The sample Lutro font provided by the Lutro project.