Files
dusk/.claude/rpg/index.md
T
2026-06-18 14:59:21 -05:00

1.1 KiB

RPG Layer

The RPG layer lives in src/dusk/rpg/ and is the game-logic tier above the engine. It is initialized and ticked by engine.c via rpgInit / rpgUpdate / rpgDispose. The rpg_t struct is currently a stub; all meaningful state lives in the subsystems below.

Contents

  • world.md — scene manager, overworld map, chunks, tiles, coordinate system, camera
  • entity.md — entity pool, types, direction, animation, interaction, player, NPC
  • cutscene.md — cutscene system, item types, mode control, textbox
  • story.md — story flags, items, inventory, backpack, save system

Scene system

The scene manager (src/dusk/scene/) sits above the RPG layer and owns the single active scene. Scenes are identified by scenetype_t and registered in SCENE_TYPES[] (scene/scenetype.c) as scenecallbacks_t (init / update / render / dispose).

scenedata_t is a union so all scene structs share memory. sceneSet(type) defers the transition — the old scene disposes before the new one inits.

Currently the only scene is SCENE_TYPE_OVERWORLDsrc/dusk/scene/overworld/sceneoverworld.c.