Files
prosperon/docs/prosperon.md
2026-02-24 21:08:46 -06:00

51 lines
2.3 KiB
Markdown

---
title: "About Prosperon"
type: docs
---
# Prosperon
Prosperon is a 2D game programming environment built on [Pit](https://crumbpit.org), an actor-based language designed for safe, sandboxed scripting.
Games are written as small, focused modules in Pit — a simplified JavaScript with actor primitives. Prosperon handles rendering, input, audio, and asset management. No class hierarchies, no giant scene trees.
## Design Goals
- **Minimal API surface.** A handful of modules cover sprites, input, sound, and composition. Each does one thing.
- **Data-driven rendering.** You create sprites and set properties. The compositor handles batching, sorting, and GPU submission.
- **Composition over inheritance.** Entity behavior comes from modules, not class trees. An entity type is a script that returns a prototype object.
- **AI-friendly.** Many small files with simple dependencies. An LLM can read a module, understand it, and modify it.
- **Text-first.** Assets are referenced as string paths. Levels are JSON. Everything diffs cleanly in source control.
## Architecture
Prosperon is not a monolithic engine with a global state object. It is a collection of modules:
| Module | Purpose |
|--------|---------|
| `core` | Main loop, window, GPU init |
| `sprite` | Create and manage sprites |
| `compositor` | Build render plans from scene configs |
| `input` | Action mapping, device routing |
| `sound` | Audio playback |
| `world` | Entity management (add, query, update, levels) |
| `camera` | Viewport into the world |
| `draw2d` | Re-exports sprite, shape, text, tilemap, anim |
| `text2d` | Text rendering |
| `shape2d` | SDF shapes (rect, circle, ellipse, pill) |
| `anim2d` | Sprite animation playback (aseprite/gif) |
| `collision2d` | AABB + circle overlap queries |
| `tilemap2d` | Grid-based tile rendering |
| `tween` | Value interpolation |
| `resources` | Asset path resolution |
Import what you need with `use()`. If you don't use a module, it doesn't load.
## The Language
Pit is an actor-based language. Programs (`.ce` files) are actors that run top-to-bottom, can register message handlers, and spawn child actors. Modules (`.cm` files) return frozen values and are cached.
Actor primitives: `$start`, `$receiver`, `send`, `$delay`, `$clock`, `$stop`.
See [Quickstart](../quickstart/) for a hands-on introduction.