---
title: "Prosperon Manual"
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.

You write game logic in Pit — a simplified JavaScript with actor primitives — and Prosperon handles rendering, input, audio, and asset management. Games are composed from small, focused modules. No class hierarchies, no giant scene trees.

## How It Works

A Prosperon game is a collection of **modules** (`.cm`) and **programs** (`.ce`).

- **Modules** return a frozen value — an API, a config, a data table. Import them with `use()`.
- **Programs** are actor entry points. They run top-to-bottom, register message handlers, and spawn children.

The engine provides modules for everything a 2D game needs:

| Module | Purpose |
|--------|---------|
| `sprite` | Create and register sprites |
| `draw2d` | High-level factories for sprites, text, shapes, tilemaps |
| `camera` | Create cameras with transform and projection |
| `input` | Multi-device action mapping with control stacks |
| `sound` | Audio playback with PCM caching and voice mixing |
| `tween` | Fire-and-forget animation with easing |
| `world` | Entity management and lifecycle |
| `resources` | Asset discovery and path resolution |
| `core` | Main loop, window, frame scheduling |

You create sprites, poke their positions, and the engine handles everything else — batching, sorting, effects, presentation scaling. Like programming sprites on a GBA, but with modern hardware behind it.

## Design Principles

**Minimal code.** The fewer lines it takes to do something, the fewer bugs it has, the faster it runs, and the less you need to keep in your head.

**Duck typing.** If an object looks like a sprite — has a position, an image, a layer — it works as a sprite. No base classes to inherit from.

**Text-based.** Every file in a Prosperon project is text. Scripts, configs, levels. Git diffs are readable, merges are clean.

**Modules, not globals.** Everything is accessed via `use()`. No global engine object. The world, camera, input — all imported as modules.

**Data-driven rendering.** Your game logic never touches the GPU. You declare drawables and their properties. The rendering pipeline sorts, batches, applies effects, and draws.

## Guides

- [Quickstart](quickstart/) — Run your first program
- [Tutorial](tutorial/) — Build a game step by step
- [Entities](entities/) — The world and entity model
- [Rendering](rendering/) — Sprites, cameras, and the rendering pipeline
- [Graphics](graphics/) — Textures, images, and coordinate systems
- [Input](input/) — Action mapping, devices, and control stacks
- [Resources](resources/) — Asset loading and discovery

## API Reference

- [API Index](api/) — All modules and types
