Skip to content

0018. Data-driven gameplay and UI kit in the framework

  • Status: Accepted (2026-11-27, Phase 1b gate)
  • Date: 2026-11-27
  • Phase: 1

Phase 1b needed enemies, health, pickups, checkpoints, a HUD, menus, transitions and sounds. Writing them as game code would make every AI-authored game re-implement them; the platform’s bet is that most games are data plus small behaviors.

  • @ludrel/framework gains reusable components and systems: Health, ContactDamage (with stomping), Patrol, Hover, Pickup, Checkpoint, Lifetime, PlatformerAnimator. Their systems are added to every scene automatically and do nothing without their components.
  • Scene documents gain a menu (keyboard, gamepad, mouse) and more HUD widgets (hearts, icon + value, bar, timer, {bindings} in labels). Text uses bitmap fonts (font asset type) for crisp pixel text.
  • Rules (event → actions) grow into a small action language shared by rules and menu items: scene stack (goToScene with fade, pushScene, popScene, restartScene), counters (scene or session scope), respawn, setComponent, banner, music, settings, saves, and delayMs on any action. Rules can listen to input actions (input:pause), app:hidden (auto-pause) and scene:start.
  • These live in the framework for now. If the kit grows (dialogue, inventory, quests) it moves to a gameplay package as planned for Phase 5.
  • Sprout has one small game-specific behavior (a dust puff on jump); everything else is data. That is the shape Phase 2’s AI tools will generate.
  • The framework bundle grows by the kit (~6 kB brotli) even for games that don’t use it; acceptable now, and a split is possible later.
  • The action language must stay small and well documented; anything more complex belongs in a behavior (code).