Luma

A lightweight python game engine powered by SDL3


Project maintained by ItzCyzmiX Hosted on GitHub Pages — Theme by mattgraham

Luma Engine

Luma is a small Python game engine built on SDL3. It gives you a window, a frame loop, keyboard input, and immediate-mode primitive shape drawing while leaving game state and game rules in ordinary Python code. Its graphics API includes immediate-mode primitive shape drawing and image sprites.

Documentation

Smallest useful program

from luma import Luma


engine = Luma()
engine.create_window("Luma", 640, 480)
graphics = engine.graphics


@engine.draw
def draw():
   graphics.setDrawColor(40, 120, 220)
   graphics.drawRect(220, 160, 200, 120)


@engine.update
def update(dt):
	pass


engine.run()

The Getting started guide expands this into a complete input-driven example.

Scope

Luma currently provides keyboard and quit events, primitive shape rendering, image sprites, TTF text rendering, and SDL mixer audio. It does not yet provide collision detection, scenes, cameras, or asset management. Those systems can be built in Python on top of the engine, as the Pong example demonstrates.