VEXPOLY

Python · pygame-ce · MIT

No engine. Just Python. And math.

VEXPOLY is a first-person arena shooter written in a single Python file. The camera, the clipper, the lighting, the fog — all written by hand, then handed to pygame.draw.polygon.

quickstart.sh
$ git clone https://github.com/dranimalis/vexpoly.git
$ cd vexpoly
$ python3 -m venv .venv && source .venv/bin/activate
$ pip install -r requirements.txt
$ python vexpoly.py

Python 3.9+ · pygame-ce 2.5 recommended · everything else ships in the repo

0 lines of Python
0 max polygons / frame
0 target framerate
0 render libraries used

Renderer

A 3D pipeline
written in Python.

Camera transform. Near-plane clipping. Perspective projection. Backface culling. Directional lighting. Distance fog. Depth sorting. A per-frame polygon budget. All of it runs in Python, per frame.

live preview drag to orbit
— —

Pipeline

Camera. Clip. Sort. Draw.

Every frame runs through the same eight stages. No shortcuts, no corners cut, no graphics API.

01 — 03

Camera transform & projection

Yaw, pitch, translation into view space, then a perspective divide. The result is a flat 2D coordinate per vertex.

04

Near-plane clipping

Polygons that cross the camera plane get cut before they can flip inside out.

05

Backface & frustum culling

Anything pointing away from the camera, or outside the view, is dropped before lighting runs.

06

Directional lighting

One fixed light vector, one dot product per face. Cheap, consistent, readable.

07

Distance fog

Camera-space depth drives a fade toward the sky colour, so far geometry melts into the horizon.

08

Depth sort & draw

Faces are sorted back-to-front by average camera-space depth, then handed to pygame.draw.polygon one by one.

Themes

Five looks.
One engine.

Each theme swaps the sky gradient, fog colour, light direction, colour grade, and the entire texture set. Not just a tint. Tap one — it repaints this page and the live demo above.

Controls

Keyboard and mouse.
That's the whole scheme.

Q W E cycle
A S D move
Space jump
Shift sprint
R F Esc reload / free / pause
  • MoveWASD
  • SprintShift
  • JumpSpace
  • FireLMB
  • ReloadR
  • Weapons123
  • CycleQE
  • PauseEsc
  • FullscreenF11
  • Release mouseF

Support

No ads. No telemetry.
No network calls.

VEXPOLY talks to nothing. If you want to chip in, there's a page for that. A star or a bug report helps just as much.

Support on Sociabuzz Star on GitHub