feat: Introduce core player movement manager with grid-based movement, player pushing mechanics, and initial bot control and strategic planning.

This commit is contained in:
Yogi Wiguna
2026-03-05 16:41:35 +08:00
parent aa26e9f2a4
commit 5c4764b082
7 changed files with 169 additions and 47 deletions
+18
View File
@@ -304,6 +304,24 @@ func _check_spiral_cell(x: int, z: int, tile_types: Array, result_array: Array):
if _normalize_tile(item) in tile_types:
result_array.append(Vector2i(x, z))
func find_nearest_roaming_tekton() -> Node3D:
"""Find the nearest Tekton that isn't carried and is on the grid."""
var tektons = actor.get_tree().get_nodes_in_group("Tektons")
var nearest_tekton = null
var min_dist = 999999.0
for tekton in tektons:
if not is_instance_valid(tekton): continue
if tekton.get("is_carried") or tekton.get("is_static_turret"): continue
if tekton.get("is_recovering"): continue # Cannot target shrinking/recovering Tektons
var dist = actor.global_position.distance_to(tekton.global_position)
if dist < min_dist:
min_dist = dist
nearest_tekton = tekton
return nearest_tekton
# =============================================================================
# Movement Strategy
# =============================================================================