A delightfully simple 2D game engine for the D programming language. Parin is designed to make game development fast and fun β it's easy to set up, hackable, and comes with the essentials built in.
Worms Within
A bite-sized escape room game.
A list of projects made with Parin is available in the projects page.
- Focused 2D engine β not an everything engine
- Pixel-perfect physics engine
- Flexible dialogue system
- Atlas-based animation library
- Efficient tile map structures
- Intuitive immediate-mode UI
- Mixed memory model β choose manual control, GC, or both
- Built-in memory allocators: tracking, frame, and arena
- Modular design β just
import parin.engine - Includes extras like microui
- Cross-platform (Windows, Linux, macOS, Web)
import parin;
// Called once when the game starts.
void ready() {
lockResolution(320, 180);
}
// Called every frame while the game is running.
// If true is returned, then the game will stop running.
bool update(float dt) {
drawText("Hello world!", Vec2(8));
return false;
}
// Called once when the game ends.
void finish() {}
// Creates a main function that calls the given functions.
mixin runGame!(ready, update, finish);This guide shows how to install Parin using DUB. Create a new folder and run inside the following commands:
dub init -n
dub run parin:setup
dub runIf everything is set up correctly, a window will appear showing the message "Hello world!". For instructions on building without DUB, check the "How can I build without DUB?" section.
Some libraries for sound, graphics, and input handling are required before using Parin on Linux. Below are installation commands for some Linux distributions.
sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-devsudo dnf install alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel libatomicsudo pacman -S alsa-lib mesa libx11 libxrandr libxi libxcursor libxineramaStart with the examples folder or the cheatsheet for a quick overview.
For more details, see the tour page.
The parin.types and parin.engine modules are easy to read and show what's available.
If you notice anything missing or want to contribute, feel free to open an issue! You can also share things in the GitHub discussions. Most ideas are welcome, except ECS.
- Latest: September 2025
- More: dev.to/kapendev
Create a new folder and run inside the following commands:
git clone --depth 1 https://github.com/Kapendev/parin parin_package
./parin_package/scripts/prepare
# Or: .\parin_package\scripts\prepare.bat./parin_package/scripts/run
# Or: .\parin_package\scripts\run.bat
# Or: ./parin_package/scripts/run ldc2 macos
# Or: ./parin_package/scripts/run opendParin includes a build script for the web in the packages folder. Building for the web also requires Emscripten. By default, Parin's web builds use the BetterC flag, meaning only projects compatible with BetterC can be compiled.
dub run parin:web./parin_package/scripts/web
# Or: .\parin_package\scripts\web.batProjects requiring the full D runtime can be built using the GC flag.
This flag also requires OpenD and the latest version of Emscripten.
Note that exceptions are not supported and that some DUB related limitations apply like having to include all dependencies inside the source folder.
Before using the GC flag, make sure opend install xpack-emscripten has been run at least once.
dub run parin:web -- gc./parin_package/scripts/web gc
# Or: .\parin_package\scripts\web.bat gcBelow are installation commands for Emscripten for some Linux distributions.
sudo apt install emscriptensudo dnf install emscriptenyay -S emscripten
# Or: sudo pacman -S emscriptenVec2 is a type provided by the Joka library, which Parin depends on.
An example using this type can be found in Joka.
Call setIsUsingAssetsPath(false) to disable the default behavior.
Or setAssetsPath(assetsPath.pathDirName) to load from the executable's folder.
Asset hot reloading is not supported out of the box. The arsd libraries may help.
Yes. Be sure to check the associated README for any licensing notes.
No. Raylib is the current backend. A custom backend may be added in the future, but it's not a priority.
The goal is a smooth experience, similar to Godot or Unity.