Skip to content

Games and CelerGame

celeros-ci edited this page Nov 19, 2026 · 1 revision

Games and CelerGame

English | Português (BR)

Games on CelerOS are JavaScript (ES5, Duktape) built on top of CelerGame — the game-engine family shipped as shared dependencies on the hub (celeros.game*). The engine decorates a single object E, so a game adopts only what it needs: one require per module, zero vendored code, and the hub resolves/installs everything on install.

The family

Dependency Gives
celeros.game (core 1.7) scenes + loop, input (multitouch API 43), gfx, camera, math, timers/tweens/seq, groups/pools, dirty layer, audio (music + sfx tables), save (NVS), screen sleep hooks (E.onSleep/E.onWake, API 51), culling and node hierarchy (celeros.game.node)
celeros.game.fx particles, popText, flash, rings, stars, emitters, trails, parallax
celeros.game.spr PNG sprites in hardware slots, spritesheets (sheet/grid), stamp with scale, flipbooks (anim, directional clips)
celeros.game.tilemap dirty-cell tilemaps, solid queries, baked-room rendering
celeros.game.ui title / pause / game-over screens, menus, scrolling lists, dialogs, confirm, toast
celeros.game.pad floating joystick + buttons, multitouch (API 43), single-touch fallback
celeros.sfx chiptune sfx library (transpose/vary/join/combos), played through E.audio
celeros.physics verlet (native on API 31+), rigid bodies (API 33+)
celeros.game.collide / .events / .fsm / .level / .path / .steer / .gen / .inv / .script / .stats / .waves the "brain" modules: shapes + spatial hash + sweeps, event bus, state machines, ASCII levels + star progress, A*/flow, steering, dungeon/cave/maze gen, inventory, cutscene scripts, stats/XP, wave director
celeros.game.combat / .world hitboxes/projectiles/knockback; screen-sized rooms with sliding, minimap and per-room state
celeros.game.kit / .rpg bundles that fit the brain modules inside the 8-dependency ceiling of app.json (rpg = stats + inv + script)

The hub accepts at most 8 dependencies per app — pick the modules you use (or celeros.game.kit for the whole brain). Big games target the S3 boards with PSRAM: declare "requires": ["psram"].

Games on the bench (all installable from the App Store)

2048, 2D Runner (Neon Surfer), Arrasa!, Breakout, Campo Minado, Detona!, Physics Drop, Pong Duplo (two screens over the Celer Link), Supernova and Tic Tac Toe — all built on CelerGame, several with AI-generated art.

Art generated by AI (text2d / texture2d)

Game art is generated with the bench CLIs and shipped flat in the app root (the hub package does not carry subdirectories):

  • text2d — text → image (sprites with transparent background: --category icon --transparent).
  • texture2d — seamless textures for floors/walls/backdrops (texture2d batch prompts.txt).

Pack the sprites into one ai_atlas.png (grid of 64 px cells on a magenta background, key color 0xF81F) and one ai_bg.png backdrop, then:

E.init({ dir: "MeuJogo", bases: ["/local/apps/MeuJogo/", "/sd/apps/MeuJogo/"] });
E.spr.grid("ai", { file: "ai_atlas", cols: 4, rows: 4, tw: 64, th: 64, prefix: "ai" });
E.spr.sheet("aibg", { file: "ai_bg", w: 256, h: 256, regions: { bg: [0, 0, 256, 256] } });
E.spr.stamp("ai0", x, y, { scale: 0.5, key: 0xF81F, ax: 0.5, ay: 0.5 }); // scaled blit
E.spr.stamp("bg", 0, 0, { scale: E.W / 256, key: null });               // backdrop

Keep a procedural/text2d fallback for boards without PNG support (E.spr.backed() tells you which one is live).

Apps on the SD card

Big games install into the SD card (/sd/apps): the flash partition is small (3.4 MB) and the cards are 16 GB+. From the bench:

celerctl -p IP apps store --sd celeros.supernova   # install from the hub into the card
celerctl -p IP shell sd format                     # card without FAT32? formats (WIPES the card)

The launcher scans /local/apps and /sd/apps; remove one copy to avoid duplicates. Cards formatted exFAT (Windows default on big cards) are not readable by the firmware — sd format lays down FAT32 (one explicit command; the mount never formats on its own). Full details in boards/AGENTS.md (repo).

Reading more

  • App Development Guide — app.json, SDK, publish (the Game Engine Guide lives in the repo: Documentation/Game_Engine_Guide.md).

Clone this wiki locally