feat: Introduce static Tekton stands with a new manager for strategic, non-adjacent placement and synchronized randomized shapes.

This commit is contained in:
Yogi Wiguna
2026-02-13 13:51:51 +08:00
parent 6472e47edf
commit 98f107893d
3 changed files with 53 additions and 12 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ const STATIC_CONTROLLER_SCRIPT = "res://scripts/static_tekton_controller.gd"
# Mid-Left, Mid-Mid, Mid-Right
# Bot-Left, Bot-Mid, Bot-Right
func calculate_spawn_points(count: int, gridmap: Node) -> Array:
func calculate_spawn_points(count: int, gridmap: Node) -> Array[Vector2i]:
"""
Calculates random spawn positions for static tektons.
Returns an Array of Vector2i positions.
@@ -39,7 +39,7 @@ func calculate_spawn_points(count: int, gridmap: Node) -> Array:
# If count < 5, we prioritize corners then center
# If count > 5, we only return 5 because that's the max safe non-adjacent set in 3x3
var spawn_points = []
var spawn_points: Array[Vector2i] = []
var iterations = min(count, target_indices.size())
for i in range(iterations):
+1 -6
View File
@@ -31,7 +31,6 @@ func _update_mesh_from_index():
var shapes = [
_create_cylinder(),
_create_box(),
_create_prism(),
_create_sphere()
]
@@ -61,11 +60,7 @@ func _create_box() -> BoxMesh:
var mesh = BoxMesh.new()
mesh.size = Vector3(3.2, 0.6, 3.2)
return mesh
func _create_prism() -> PrismMesh:
var mesh = PrismMesh.new()
mesh.size = Vector3(3.2, 0.6, 3.2)
return mesh
func _create_sphere() -> SphereMesh:
# A flattened sphere acting like a dome stand