Implements mini map and updates door lights

This commit is contained in:
2026-03-10 11:24:36 -04:00
parent b709b64a52
commit db44a1a318
5 changed files with 206 additions and 7 deletions
+16 -7
View File
@@ -8,15 +8,20 @@ const DOOR_THICKNESS := 12.0
const INDICATOR_SIZE := 10.0
const INDICATOR_OFFSET := 20.0 # distance above door
# Indicator light colors (brighter versions of room floor colors)
# Indicator light colors - only for special rooms, matching floor colors but brighter
const INDICATOR_COLORS := {
RoomData.RoomType.START: Color(0.3, 0.3, 0.5), # blue-gray
RoomData.RoomType.COMBAT: Color(0.35, 0.35, 0.55), # blue-gray
RoomData.RoomType.ITEM: Color(0.2, 0.5, 0.2), # green
RoomData.RoomType.SHOP: Color(0.6, 0.45, 0.2), # gold/amber
RoomData.RoomType.BOSS: Color(0.7, 0.15, 0.15), # red
RoomData.RoomType.ITEM: Color(0.2, 0.45, 0.2), # green (brighter version of 0.10, 0.16, 0.10)
RoomData.RoomType.SHOP: Color(0.9, 0.75, 0.1), # yellow
RoomData.RoomType.BOSS: Color(0.7, 0.15, 0.15), # red (brighter version of 0.20, 0.08, 0.08)
}
# Room types that should show indicator lights
const SPECIAL_ROOM_TYPES := [
RoomData.RoomType.ITEM,
RoomData.RoomType.SHOP,
RoomData.RoomType.BOSS,
]
# ---------------------------------------------------------------------------
# State
# ---------------------------------------------------------------------------
@@ -71,6 +76,10 @@ func _build_barrier() -> void:
func _build_indicator() -> void:
# Only show indicators for special rooms (ITEM, SHOP, BOSS)
if adjacent_room_type not in SPECIAL_ROOM_TYPES:
return
_indicator = Polygon2D.new()
# Small diamond shape for indicator
@@ -89,7 +98,7 @@ func _build_indicator() -> void:
"right": offset = Vector2(door_size.x / 2.0 + INDICATOR_OFFSET, 0)
_indicator.position = offset
_indicator.color = INDICATOR_COLORS.get(adjacent_room_type, INDICATOR_COLORS[RoomData.RoomType.COMBAT])
_indicator.color = INDICATOR_COLORS[adjacent_room_type]
add_child(_indicator)
+7
View File
@@ -20,6 +20,7 @@ const ENTRY_INSET := 60.0 # how far from wall edge the player appears
# State
# ---------------------------------------------------------------------------
var _rooms: Dictionary = {} # Vector2i -> Room
var _rooms_data: Dictionary = {} # Vector2i -> RoomData (for mini map)
var _current_grid: Vector2i
var _transitioning: bool = false
@@ -40,6 +41,7 @@ func _build_floor(floor_data: Array) -> void:
rooms_container.add_child(room_node)
room_node.setup(room_data, self)
_rooms[room_data.grid_pos] = room_node
_rooms_data[room_data.grid_pos] = room_data
if room_data.type == RoomData.RoomType.START:
start_pos = room_data.grid_pos
@@ -51,6 +53,10 @@ func _build_floor(floor_data: Array) -> void:
_current_grid = start_pos
_rooms[start_pos].activate()
# Emit signals for mini map
EventBus.floor_map_ready.emit(_rooms_data)
EventBus.room_entered_at.emit(start_pos)
# ---------------------------------------------------------------------------
# Transitions
# ---------------------------------------------------------------------------
@@ -59,6 +65,7 @@ func transition_to(target_grid: Vector2i, from_direction: String) -> void:
return
_transitioning = true
_current_grid = target_grid
EventBus.room_entered_at.emit(target_grid)
var new_world := _grid_to_world(target_grid)