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
+8 -1
View File
@@ -832,6 +832,12 @@ func _assign_random_spawn_positions():
var mid_x = enhanced_gridmap.columns / 2
var mid_z = enhanced_gridmap.rows / 2
# If static positions were not calculated yet, do it now to avoid players spawning in them
if reserved_static_positions.is_empty() and LobbyManager.game_mode != "Stop n Go":
if not static_tekton_manager:
static_tekton_manager = preload("res://scripts/managers/static_tekton_manager.gd").new()
reserved_static_positions = static_tekton_manager.calculate_spawn_points(3, enhanced_gridmap)
for x in range(enhanced_gridmap.columns):
for z in range(enhanced_gridmap.rows):
var ground = enhanced_gridmap.get_cell_item(Vector3i(x, 0, z))
@@ -839,7 +845,8 @@ func _assign_random_spawn_positions():
var pos = Vector2i(x, z)
# SAFETY CHECK: Is this reserved for a Static Tekton Stand?
# Stand clears 3x3, but we use a radius of 2 (5x5) for safety
# Stand clears 3x3, we use a strictly >= 1 check (so abs <= 1 is EXACTLY the 3x3 stand)
# Let's use a 3x3 check (1 radius) to avoid strictly the stand itself, plus 1 buffer = radius 2.
var is_safe = true
for reserved in reserved_static_positions:
if abs(x - reserved.x) <= 2 and abs(z - reserved.y) <= 2: