Kraken supports both Python and C++. Choose the setup for your project:
- Python: install the package and import
pykraken. - C++: create a CMake project that builds and links the native engine.
Python
You’ll need Python 3.11 or newer.
Create a Virtual Environment
A virtual environment keeps your project’s Python dependencies separate. This step is recommended but optional.
macOS and Linux:
python3 -m venv .venv
source .venv/bin/activate
Windows (PowerShell):
python -m venv .venv
.venv\Scripts\Activate.ps1
Install Kraken
With your environment activated, install the package:
python -m pip install kraken-engine
If you skipped the virtual environment, use python3 instead of python on systems where that is your Python command.
In your Python files, use import pykraken as kn. The package is named kraken-engine, the import is pykraken, and the command-line tool is kraken.
Create a Python Project
kraken init my-game
cd my-game
python main.py
The generated project includes a working window and render loop. Continue with Creating a Window to learn how it works.
Update the Python Package
Run this in the same environment where you installed Kraken:
python -m pip install --upgrade kraken-engine
C++
You’ll need a C++20-capable compiler, CMake 3.24 or newer, and Git for the source-build setup below. The kraken project generator also requires Python 3.11 or newer; your C++ application runs as a native executable.
Install the Project Generator
Install the Python package to get the kraken command. You can use the virtual environment instructions above to keep it isolated.
python -m pip install kraken-engine
Use python3 if that is your Python command. If you already installed the package for Python, the same kraken command can create C++ projects.
Create a C++ Project
kraken init my-game --cpp
cd my-game
This creates a CMake project with src/main.cpp. Its first build downloads and builds the matching Kraken version and native dependencies from source, so allow extra time for that build.
Build and Run
From the generated project directory:
cmake --preset dev
cmake --build --preset dev
Run the generated executable from the project directory so relative asset paths resolve correctly. It is usually under build/; multi-configuration generators such as Visual Studio place it in a configuration subdirectory such as build/Debug/ or build/Release/.
The generated CMake configuration links your application to Kraken::Kraken. Include the engine header in your C++ files:
#include <kraken/KrakenEngine.hpp>
Engine symbols live in the kn namespace. The guides provide Python and C++ versions of their examples; choose the C++ tab as you read.
Update a C++ Project
Updating the Python package updates the project generator. Existing C++ projects keep the engine version recorded in their CMake configuration or downloaded SDK. To upgrade one, update its engine source tag or SDK as well, then configure and build again.