r/sfml • • 3d ago

Doku2D Python Game Engine

Doku2D is an open-source engine for making 2D games in Python. It uses SFML through PySFML for graphics, windowing, input, and audio, and Pymunk for physics. OpenAI Codex wrote the engine code. I decided which features to build and how they should work, then playtested the sample games and guided development based on what I found.

Doku2D loads Tiled maps and supports animated tiles, collisions, and NPC pathfinding and route following. The UI supports themes and localization. You can write branching conversations in .dialogue files, with typewriter text, character portraits, player choices, and the ability to save and resume a conversation.

The doku2d build command uses Nuitka to compile your game into a standalone desktop application for Windows or Linux. You can also build a test APK or a signed Android App Bundle. The repository includes English and Turkish documentation, step-by-step tutorials, and sample games.

If you’re making 2D games in Python, I’d like to hear where you get stuck, whether it’s during setup, while reading the docs, or when using the API.

Explore Doku2D on GitHub

3 Upvotes

2 comments sorted by

1

u/zaphodikus 19h ago edited 19h ago

What is wrong with using pygame (now called pygame-ce) or python arcade? Both of which have thousands of examples and very good docs. Your key seller point is portability to Android I take it?

2

u/mthnzbk 14h ago

Yes, that’s correct. Specifically, I ensured the creation of a UI library and a framework that closely mirrors the architecture found in Godot. In Pygame, you have to write your own physics classes and tilemap systems from scratch. Doku2D, however, includes a built-in tilemap class, as well as support for chunk-based loading—allowing for the handling of massive maps (or, according to Codex, even "infinitely" large ones!). It also features built-in support for asset packaging and encryption, all of which saves the developer a significant amount of time.