Beam is a small C++17 game engine built on top of raylib, with a
Node → Scene/GameObject hierarchy, an App/Manager game loop, and optional
nanobind-based Python bindings.
- Node hierarchy —
Node,Event,Scene, andSceneManagerfor composing and updating a tree of game objects. - Game objects —
Text,Button,Input,Sprite,Frame, andTileMapbuilt on a commonGameObjectbase. - App loop —
App/Managerwrap raylib's window, input, and asset handling. - WebSockets —
WebSocketClient(via websocketpp/ASIO) for talking to a server from the game loop. See WEBSOCKET_INTEGRATION.md. - Python bindings — the same API exposed as the
beampackage, generated from python/src/bindings.cpp.
Requires CMake 3.15+ and a C++17 compiler. raylib, ASIO, and websocketpp are fetched
automatically via FetchContent if not already installed.
./init.sh # configures into ./build
cmake --build buildExample binaries are written under build/examples/<name>/. Build options (set with
-D<OPTION>=ON|OFF at configure time):
| Option | Default | Description |
|---|---|---|
BEAM_BUILD_EXAMPLES |
ON |
Build the executables under examples/. |
BEAM_BUILD_PYTHON_BINDINGS |
OFF |
Build the _beam nanobind extension module (requires the nanobind Python package). |
The Python package lives in python/beam/ and wraps the compiled _beam extension
module. Build and install it with scikit-build-core:
uv sync # or: pip install -e .import beam
app = beam.App("my game", 640, 360, 60)
...See examples/python_demo/main.py for a complete example.
include/beam/ Public C++ headers (core, objects, scene)
src/ C++ implementation
python/ nanobind bindings (python/src) and the beam package (python/beam)
examples/ basic_game, websocket_example, and python_demo
scripts/ maintenance scripts (e.g. bump_version.py)
CMakeLists.txt's project(Beam VERSION X.Y.Z ...) is the source of truth for the project
version; pyproject.toml's version is kept in sync with it. Bump both with:
scripts/bump_version.py {major,minor,patch}