Camera and Room Bounds

Camera2D on the player, Room areas, smallest-room-wins, limit expansion.

stablegodotarchitecture
On this page

Implemented

Camera clamped to a narrow stairwell between floors
Stairwell room wins (smallest overlapping rect) so the camera can travel vertically between floors.

player_camera.gd on a Camera2D child of the clerk (zoom = 1.5). Each frame it finds which Room (Area2D + rect) contains the camera/player position and sets limit_*.

Rooms are collected from group "room".

Smallest room wins

200 hallway with camera limits matching the hallway room
On the 200 hallway, limits snap back to that floor’s wide, short room bounds.

Doorways and stairwells overlap multiple Room rects. Choosing the smallest area lets a narrow stairwell take over from a wide hallway so vertical travel is not clamped to one floor’s height.

Limits smaller than the view

Godot fights camera limits tighter than the visible area. Expand the rect:

var view := get_viewport_rect().size / zoom
if grown.size.x < view.x:
	grown.position.x -= (view.x - grown.size.x) * 0.5
	grown.size.x = view.x

HUDs stay put

Title screen Control UI on its own scene
Title screen is a separate Control scene — another reminder that UI lives in screen space, not the hotel world.

Dialog and clock are CanvasLayers — they do not move with the camera.