feat: implement main game scene and player logic with modular manager architecture

This commit is contained in:
Yogi Wiguna
2026-03-31 12:24:26 +08:00
parent 7c4c799e2b
commit 82f2811c26
3 changed files with 11 additions and 5 deletions
+3 -3
View File
@@ -1317,18 +1317,18 @@ func is_position_occupied(pos: Vector2i) -> bool:
if p.is_player_moving and p.target_position == pos:
return true
# Prevent overlap with Static Tekton Stands (3x3 area) using active nodes
# Prevent overlap with Static Tekton Stands (3x3 area, with 1-tile buffer = 5x5 checked)
if enhanced_gridmap:
for stand in get_tree().get_nodes_in_group("StaticTektonStands"):
var local_pos = enhanced_gridmap.to_local(stand.global_position)
var stand_map_pos = enhanced_gridmap.local_to_map(local_pos)
if abs(pos.x - stand_map_pos.x) <= 1 and abs(pos.y - stand_map_pos.z) <= 1:
if abs(pos.x - stand_map_pos.x) <= 2 and abs(pos.y - stand_map_pos.z) <= 2:
return true
var main_node = get_tree().get_root().get_node_or_null("Main")
if main_node and "reserved_static_positions" in main_node:
for reserved in main_node.reserved_static_positions:
if abs(pos.x - reserved.x) <= 1 and abs(pos.y - reserved.y) <= 1:
if abs(pos.x - reserved.x) <= 2 and abs(pos.y - reserved.y) <= 2:
return true
return false