A delightfully simple and lightweight 2D game engine for the D programming language.
Find a file
2024-08-28 04:06:02 +03:00
examples Small coin example change. 2024-08-28 04:06:02 +03:00
scripts Fixed font loading bug and random stuff. 2024-08-26 12:12:41 +03:00
setup Fixed setup bug and changed chat to dialogue again. 2024-08-13 22:55:15 +03:00
source/popka Big change to make resources easier to use. 2024-08-28 03:51:33 +03:00
web Fixed web bug and added vsync support. 2024-08-14 17:21:57 +03:00
.gitignore Core is now a package. 2024-08-08 11:08:55 +03:00
dub.json I think everything works now. 2024-08-13 13:28:23 +03:00
LICENSE First. 2024-03-05 07:59:55 +02:00
README.md Big change to make resources easier to use. 2024-08-28 03:51:33 +03:00
TOUR.md Removed the use of window functions from the user. 2024-08-26 18:13:34 +03:00

Popka

Popka is a lightweight and beginner-friendly 2D game engine for the D programming language. It focuses on providing a simple foundation for building 2D games.

import popka;

void ready() {
    lockResolution(320, 180);
}

bool update(float dt) {
    drawDebugText("Hello world!");
    return false;
}

void finish() { }

mixin runGame!(ready, update, finish);

Warning

This is alpha software. Use it only if you are very cool.

Supported Platforms

  • Windows
  • Linux
  • MacOS
  • Web

Games Made With Popka

Dependencies

Installation

This guide shows how to install Popka and its dependencies using DUB. While DUB simplifies the process, Popka itself doesn't require DUB.

Create a new folder and run inside the following commands:

dub init -n
dub run popka:setup

The final line modifies the default app.d and dub.json files, downloads raylib, and creates the necessary folders for Popka to function properly. The following folders will be created:

  • assets: This folder is used to store game assets.
  • web: This folder is used for exporting to the web.

Once the installation is complete, run the following command:

dub run

If everything is set up correctly, a window will appear showing the message "Hello world!". To avoid downloading raylib, pass offline to the script.

Documentation

For an initial understanding, the examples folder can be a good starting point. For a more detailed overview, check the TOUR.md file.

Attributes and BetterC Support

This project offers support for some attributes (@safe, @nogc, nothrow) and aims for good compatibility with BetterC. If you encounter errors with BetterC, try using the -i flag.

Web Support

To export a game to the web, the game must be compatible with BetterC. The web folder contains a helper script to assist with the web export process.

It can be used with DUB by running the following command:

dub run popka:web

Note

I add things to Popka when I need them.

License

The project is released under the terms of the MIT License. Please refer to the LICENSE file.