Files
prosperon/website/content/_index.html
John Alanbrook 83b798e365 Add Hugo website and rewrite docs to match current engine
New Hugo site in website/ with prosperon.dev theme (blue/gold/castle
aesthetic), docs sidebar navigation, and content pages. Rewrote all
doc files to align with the actual codebase: compositor+film2d
rendering, use() modules (no global prosperon object), Pit language,
script+JSON entity model. Added entities.md, front matter to all
70+ API docs, and updated API index for current module architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:09:55 -06:00

166 lines
8.4 KiB
HTML

---
title: "Prosperon Engine"
---
<!-- Hero -->
<section class="hero">
<a class="hero-image" href="/"><img src="/images/prosperon_load.gif" alt="Prosperon Engine" /></a>
<p>
A minimal, fast, and flexible <strong>2D game engine</strong> built on <a href="https://crumbpit.org">Pit</a>&mdash;an actor-based language designed for safe, sandboxed scripting. Prosperon gives you a compositor-driven rendering pipeline, multi-device input, and reflective tooling, all in a tiny executable you version with your project.
</p>
</section>
<!-- What Is Prosperon -->
<section class="section">
<h2>What Is Prosperon?</h2>
<p>
Prosperon is a <strong>game programming environment</strong> for 2D games. Think of it like a 2D S&amp;Box: you write game logic in Pit (a simplified, sandboxed JavaScript), and Prosperon handles rendering, input, audio, and asset management. Games are written as small, focused modules that compose together&mdash;no class hierarchies, no giant scene trees.
</p>
<p>
The engine ships as a single executable. Drop it in a folder, write your scripts, and run. Your entire project is text files&mdash;friendly to source control, easy for collaborators, and readable by AI tools.
</p>
</section>
<!-- Key Features -->
<section id="features" class="section">
<h2>Key Features</h2>
<div class="feature-grid">
<div class="feature-card">
<h3>Compositor Rendering</h3>
<p>Describe your scene as planes, layers, and effects. The compositor builds a render plan&mdash;bloom, masks, shader passes&mdash;and the SDL GPU backend executes it. You declare what to draw; the engine decides how.</p>
</div>
<div class="feature-card">
<h3>Duck-Typed Sprites</h3>
<p>If an object looks like a sprite, it <em>is</em> a sprite. Register any object with <code>film2d</code> and it draws. No base classes, no component systems to configure. Just data.</p>
</div>
<div class="feature-card">
<h3>Actor-Based Scripting</h3>
<p>Game logic runs in Pit&mdash;an actor language where each program has its own heap and message queue. Spawn actors, send messages, schedule work with <code>$delay</code> and <code>$clock</code>. Clean isolation without threads.</p>
</div>
<div class="feature-card">
<h3>Multi-Device Input</h3>
<p>Keyboard, mouse, gamepad, and touch&mdash;normalized into named actions. Supports user pairing, control stacks (possess/push/pop), emacs-style keybindings, and gesture recognition out of the box.</p>
</div>
<div class="feature-card">
<h3>Source-Control Friendly</h3>
<p>Every game file is text. Modules are <code>.cm</code> files, programs are <code>.ce</code> files, configs are plain objects. No binary scene files until you ship. Git merges just work.</p>
</div>
<div class="feature-card">
<h3>Tiny &amp; Self-Contained</h3>
<p>Prosperon is a single executable. No installer, no SDK, no build tools. Version it alongside your project. Supports Windows, Mac, and Linux.</p>
</div>
</div>
</section>
<!-- How It Works -->
<section class="section">
<h2>How It Works</h2>
<p>A Prosperon game is a collection of <strong>modules</strong> (<code>.cm</code>) and <strong>programs</strong> (<code>.ce</code>). Modules return frozen values&mdash;APIs, configs, data. Programs are entry points that run top-to-bottom and can spawn child actors.</p>
<p>The engine provides core modules for everything you need:</p>
<ul>
<li><strong>core</strong> &mdash; main loop, window management, frame scheduling</li>
<li><strong>film2d</strong> &mdash; drawable registry (sprites, shapes, text, tilemaps, particles)</li>
<li><strong>compositor</strong> &mdash; builds multi-pass render plans from scene descriptions</li>
<li><strong>input</strong> &mdash; multi-device action mapping with control stacks</li>
<li><strong>sound</strong> &mdash; audio playback with PCM caching and voice mixing</li>
<li><strong>resources</strong> &mdash; asset discovery and path resolution</li>
<li><strong>draw2d</strong> &mdash; high-level 2D drawing (points, lines, rectangles, circles)</li>
<li><strong>tween</strong> &mdash; fire-and-forget animation with easing functions</li>
</ul>
<p>You compose these into your game. A typical frame:</p>
<pre><code>// Your game registers sprites with film2d
// The compositor queries film2d for drawables
// It builds render passes (clear, draw, effects, blit)
// The GPU backend executes the command list
// Input events are normalized and dispatched to your pawns
// Audio pumps in the background via $delay</code></pre>
</section>
<!-- Rendering -->
<section class="section">
<h2>The Rendering Pipeline</h2>
<p>Prosperon's rendering is <strong>data-driven</strong>. Your game logic never touches the GPU. Instead:</p>
<ol>
<li>Register drawables (sprites, shapes, text) with <code>film2d</code></li>
<li>Describe your scene as planes with optional effects (bloom, masks)</li>
<li>The <strong>compositor</strong> queries film2d, sorts by layer, builds render passes</li>
<li>The <strong>SDL GPU backend</strong> executes the command list on Metal/Vulkan/DirectX</li>
<li>Final output is blitted to screen with letterbox, integer scale, or stretch</li>
</ol>
<p>
This means you can inspect the entire render plan as data. Debug it, log it, swap backends. The renderer supports sprite batching, y-sorting, effect pipelines (threshold + blur for bloom, mask rendering), and multiple presentation modes for pixel-perfect scaling.
</p>
</section>
<!-- The Language -->
<section class="section">
<h2>The Language: Pit</h2>
<p>
Prosperon games are written in <a href="https://crumbpit.org">Pit</a>, an actor-based language that looks like simplified JavaScript. Pit is designed for <strong>safe, sandboxed execution</strong>&mdash;each actor runs in its own heap with hard memory and time limits.
</p>
<p>Key differences from JavaScript:</p>
<ul>
<li><strong>Modules</strong> (<code>.cm</code>) return frozen values&mdash;no accidental mutation</li>
<li><strong>Programs</strong> (<code>.ce</code>) are actor entry points with message handlers</li>
<li><strong>No classes</strong>&mdash;prototypal objects via <code>meme()</code> and closures</li>
<li><strong>Actor primitives</strong>&mdash;<code>$start</code>, <code>$receiver</code>, <code>send</code>, <code>$delay</code>, <code>$stop</code></li>
<li><strong>Capability-based</strong>&mdash;actors start with zero permissions, granted explicitly</li>
</ul>
<p>Pit compiles to bytecode and runs on a QuickJS-derived VM. Modules are cached as <code>.o</code> files for fast loading.</p>
</section>
<!-- Pricing -->
<section id="pricing" class="section">
<h2>Price</h2>
<p>
Prosperon is currently <strong>$25</strong> in pre-release (50% off the eventual $50 price). That one-time fee grants you:
</p>
<ul>
<li>Use of Prosperon for commercial or personal games (no royalties)</li>
<li>All updates through <strong>v1.x</strong></li>
<li>Support for <strong>Windows, Mac, and Linux</strong></li>
<li>Account on the <a href="https://discourse.prosperon.dev">official forum</a></li>
</ul>
</section>
<!-- Subscriptions -->
<section id="subscriptions" class="section">
<div class="support-subscriptions">
<div class="subscription-box purchase-box">
<h3>Plus Support</h3>
<span class="support-price">$30/year</span>
<ul>
<li>Access to support forum</li>
<li>Vote on <strong>1 feature</strong> for upcoming releases</li>
</ul>
</div>
<div class="subscription-box purchase-box">
<h3>Pro Support</h3>
<span class="support-price">$80/year</span>
<ul>
<li>Access to support forum</li>
<li>Vote on <strong>up to 5 features</strong></li>
<li>Early access to new features</li>
</ul>
</div>
</div>
</section>
<!-- Learn -->
<section class="section">
<h2>Learn</h2>
<p>
Read the <a href="/docs/">Prosperon manual</a> to learn about the module system, rendering pipeline, input handling, and deploying your game. Prosperon also ships with example games (pong, snake, chess, tetris, bunnymark) to help you learn fast.
</p>
</section>
<!-- License -->
<section id="license" class="section">
<h2>License</h2>
<p>
All Prosperon licenses are commercial. You can distribute Prosperon-based games with no royalties and freely ship the Prosperon runtime. For full details, visit the <a href="/license/">license page</a>.
</p>
</section>