Skip to content

Kapendev/parin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦆 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.

Worms Within
A bite-sized escape room game.

Game 1

A list of projects made with Parin is available in the projects page.

Major Features

  • Efficient tile map structures
  • Flexible dialogue system
  • Intuitive immediate mode UI
  • Atlas-based animation library
  • Pixel-perfect physics engine
  • Cross-language support
  • Cross-platform (Windows, Linux, macOS, Web)

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) {
    drawDebugText("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 and its dependencies using DUB. Create a new folder and run inside the following commands:

dub init -n
dub run parin:setup -- -y
dub run

If everything is set up correctly, a window will appear showing the message "Hello world!".

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! Most ideas are welcome, except ECS.

Frequently Asked Questions

Is Parin a raylib wrapper?

No. Raylib is just 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.

Where does Vec2 come from?

Vec2 is a type provided by the Joka library, which Parin depends on.

How can I load an asset outside of the assets folder?

Call setIsUsingAssetsPath(false) to disable the default behavior.

How can I hot reload assets?

Asset hot reloading is not supported out of the box. The arsd libraries may help.

How can I build without DUB?

Follow these steps:

  1. Download Joka and raylib.
  2. Compile your game using the DMD compiler with a command like:
dmd -i -I=joka_path -I=parin_path -J=parin_path -L=-lraylib game.d

Are the Parin assets free to use?

Yes. Be sure to check the associated README for any licensing notes.

About

A delightfully simple 2D game engine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages