| name | new-room |
| description | Create a new game room with scene, script, background, hotspots, and RoomManager registration |
New Room Creation
Create a complete room following the project's room architecture. Argument: room name (e.g., tavern, forest_path).
Steps
-
Create the room scene at game/scenes/rooms/<room_name>.tscn:
- Root:
Node2D
Background (Sprite2D) — room background image (320x176)
WalkableArea (NavigationRegion2D) — polygon defining where the player can walk
WalkBehind (Node2D) — sprites with z-index sorting for depth layering
Hotspots (Node2D) — container for Area2D hotspot nodes
NPCs (Node2D) — container for NPC character scenes
-
Create the room script at game/scripts/rooms/<room_name>.gd:
- Extend
Node2D
- Add
class_name (e.g., class_name TavernRoom)
- Implement interaction handlers:
_on_<hotspot>_<verb>() for each hotspot+verb combo
- Define entry points (spawn positions for the player depending on which door they came from)
- Initialize room-specific state
-
Create hotspot scripts for any interactive Area2D nodes:
- Each hotspot needs a
hotspot_name export var
- Connect
input_event signal for click detection
- Connect
mouse_entered/mouse_exited for StatusBar hover text
-
Generate background art using the art-gen skill (or use a placeholder)
-
Register the room in RoomManager:
- Add the room's scene path to the room registry
- Define entry point names and positions
- Set up any room transitions (doors connecting to other rooms)
-
Verify:
make run
Room Checklist