parin 0.0.61
A delightfully simple 2D game engine.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
This package provides sub packages which can be used individually:
parin:rin - A script interpreter for Rin.
parin:setup - A helper script that automates the project setup.
parin:web - A helper script to assist with the web export process.
🦆 Parin
A delightfully simple 2D game engine for the D programming language. Parin is designed to make game development fun — it's easy to set up and lets you jump right into making things.
<div align="center">
<p><strong>Worms Within</strong>
A bite-sized escape room game.</p>
<a href="https://kapendev.itch.io/worms-within"><img alt="Game 1" width="420px" src="https://img.itch.zone/aW1hZ2UvMzU4OTk2OC8yMTM5MTYyMC5wbmc=/original/fWBA1L.png"></a>
<p>A list of projects made with Parin is available in the <a href="https://kapendev.github.io/parin-website/pages/projects.html">projects page</a>.</p>
</div>
Major Features
- Efficient tile map structures
- Flexible dialogue system
- Intuitive immediate mode UI
- Atlas-based animation library
- Pixel-perfect physics engine
- Cross-platform (Windows, Linux, macOS, Web)
- Small C interface for cross-language use
- BetterC support
Hello World Example
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);
Quick Start
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 run
If everything is set up correctly, a window will appear showing the message "Hello world!". For instructions on building without DUB, see How can I build without DUB?.
Required Libraries on Linux
Some libraries for sound, graphics, and input handling are required before using Parin on Linux. Below are installation commands for some Linux distributions.
Ubuntu
sudo apt install libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev
Fedora
sudo dnf install alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel libatomic
Arch
sudo pacman -S alsa-lib mesa libx11 libxrandr libxi libxcursor libxinerama
Documentation
Start with the examples folder or the cheatsheet for a quick overview. For more details, check the tour page.
Ideas
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.
Frequently Asked Questions
How can I build without DUB?
Create a new folder and run inside the following commands:
Prepare folder
git clone --depth 1 https://github.com/Kapendev/parin parin_package
git clone --depth 1 https://github.com/Kapendev/joka joka_package
./parin_package/scripts/prepare
# Or: .\parin_package\scripts\prepare.bat
Compile & run
./parin_package/scripts/run
# Or: .\parin_package\scripts\run.bat
# Or: ./parin_package/scripts/run ldc2 macos
# Or: ./parin_package/scripts/run opend
How do I make a web build?
Parin 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.
Running the script with DUB
dub run parin:web
Without DUB
./parin_package/scripts/web
# Or: .\parin_package\scripts\web.bat
Projects 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.
Using the flag with DUB
dub run parin:web -- gc
Without DUB
./parin_package/scripts/web gc
# Or: .\parin_package\scripts\web.bat gc
Below are installation commands for Emscripten for some Linux distributions.
Ubuntu
sudo apt install emscripten
Fedora
sudo dnf install emscripten
Arch
yay -S emscripten
# Or: sudo pacman -S emscripten
Where does Vec2
come from?
Vec2
is a type provided by the Joka library, which Parin depends on.
An example using this type can be found in Joka.
How can I load an asset outside of the assets folder?
Call setIsUsingAssetsPath(false)
to disable the default behavior.
Or setAssetsPath(assetsPath.pathDirName)
to load from the executable's folder.
How can I hot reload assets?
Asset hot reloading is not supported out of the box. The arsd libraries may help.
Does Parin have other UI libraries?
Are the Parin assets free to use?
Yes. Be sure to check the associated README for any licensing notes.
Is Parin a raylib wrapper?
No. Raylib is the current backend. A custom backend may be added in the future, but it's not a priority.
What are Parin's priorities?
The goal is a smooth experience, similar to Godot or Unity.
- 0.0.61 released a day ago
- Kapendev/parin
- MIT
- Copyright © 2025, Alexandros F. G. Kapretsos
- Authors:
- Sub packages:
- parin:rin, parin:setup, parin:web
- Dependencies:
- joka
- Versions:
-
0.0.61 2025-Aug-29 0.0.60 2025-Aug-29 0.0.59 2025-Aug-27 0.0.58 2025-Aug-24 0.0.57 2025-Aug-20 - Download Stats:
-
-
3 downloads today
-
12 downloads this week
-
42 downloads this month
-
248 downloads total
-
- Score:
- 2.1
- Short URL:
- parin.dub.pm