feat: Add core map generation and management system
- Introduced MapData, MapGenerator, and MapPainter classes for procedural map generation. - Implemented LevelManager to handle level initialization and navigation. - Created TurnManager for managing turn order in a turn-based system. - Added Player and Enemy character classes with movement and turn-taking capabilities. - Established pathfinding using AStar2D in PathfindingHandler. - Integrated new scenes for player and enemy characters, along with world setup. - Included a new tileset for futuristic Zelda-themed assets.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
## world.gd
|
||||
# Main world node script. Sets up the map, player, and level on scene ready.
|
||||
extends Node
|
||||
|
||||
# Reference to the TileMapLayer node for rendering the map.
|
||||
|
||||
# Reference to the TileMapLayer node for rendering the map.
|
||||
var map_layer: TileMapLayer
|
||||
# Path to the Player scene to instance.
|
||||
const PLAYER_SCENE_PATH: String = "res://scenes/actors/player.tscn"
|
||||
# Reference to the Player node.
|
||||
var player: Player
|
||||
# Map generation settings (size, room count, etc.).
|
||||
var settings: MapSettings = MapSettings.new()
|
||||
|
||||
# Called when the node is added to the scene tree.
|
||||
# Initializes references and triggers map setup.
|
||||
func _ready() -> void:
|
||||
map_layer = $MapLayer
|
||||
# Do not assume Player is already in the scene tree; instance it after map generation.
|
||||
call_deferred("_initialize_map")
|
||||
|
||||
# Initializes the map and level using LevelManager.
|
||||
# Ensures the map is generated and the player is placed.
|
||||
func _initialize_map() -> void:
|
||||
# Instance the Player after the map is generated and add to the scene tree.
|
||||
var player_scene: PackedScene = load(PLAYER_SCENE_PATH)
|
||||
player = player_scene.instantiate() as Player
|
||||
add_child(player)
|
||||
LevelManager.initialize(settings, map_layer, player)
|
||||
Reference in New Issue
Block a user