Map

Inherits: Node2D

Overworld room selection tree.

Displays a procedurally generated grid of MapRoom nodes representing a 16-floor roguelike progression. Uses MapGenerator to produce the Room data grid, then spawns MapRoom nodes connected by Line2D paths.

Properties

Camera2D

camera_2d

Array[Array]

map_data

int

floor_climbed

Room

last_room

float

camera_edge_y

Methods

void

generate_new_map()

void

create_map()

void

unlock_floor(which_floor: int = floor_climbed)

void

unlock_next_rooms()

void

_on_map_room_selected(room: Room)


Property Descriptions

Camera2D camera_2d πŸ”—

Vertical scrolling camera.


Array[Array] map_data πŸ”—

2D grid of Room data objects from MapGenerator.


int floor_climbed πŸ”—

Number of floors the player has progressed through.


Room last_room πŸ”—

The most recently selected Room.


float camera_edge_y πŸ”—

Upper Y clamp for camera scroll: Y_DIST * (FLOOR - 1).


Method Descriptions

void generate_new_map() πŸ”—

Generates a new set of rooms via MapGenerator and builds the visual map.


void create_map() πŸ”—

Spawns MapRoom nodes for all rooms with outgoing connections, plus the boss room at the top floor. Centers visuals on screen.


void unlock_floor(which_floor: int = floor_climbed) πŸ”—

Sets MapRoom.available on all rooms in which_floor.


void unlock_next_rooms() πŸ”—

Sets MapRoom.available on rooms connected to last_room.


void _on_map_room_selected(room: Room) πŸ”—

Locks all rooms on the selected room’s floor, records it, increments floor_climbed, and unlocks connected rooms on the next floor.