feat: Add initial main scene with grid map, UI, touch controls, and core game logic scripts.

This commit is contained in:
Yogi Wiguna
2026-02-18 11:50:10 +08:00
parent 489e31fb39
commit 446e142a29
4 changed files with 12 additions and 19 deletions
+5 -15
View File
@@ -697,13 +697,16 @@ func _create_tekton(pos: Vector2i, tekton_id: int, is_static: bool = false):
add_child(tekton)
# Initialize
if is_static:
tekton.is_static_turret = true
if tekton.has_method("initialize"):
if has_node("EnhancedGridMap"):
tekton.initialize(pos, $EnhancedGridMap)
# If Static, swap controller
if is_static:
tekton.is_static_turret = true
# tekton.is_static_turret = true # Already set above
var old_controller = tekton.get_node_or_null("TektonController")
if old_controller:
@@ -760,10 +763,7 @@ func spawn_static_tektons():
# Pick Shape on Server (0:Cyl, 1:Box, 2:Prism, 3:Sphere)
var shape_idx = randi() % 4
# Spawn on Server
_create_static_setup(pos, id, shape_idx)
# Sync to Clients
# Spawn on Server AND Sync to Clients (call_local handles both)
rpc("sync_spawn_static_setup", pos, id, shape_idx)
@rpc("call_local", "reliable")
@@ -837,16 +837,6 @@ func _create_static_setup(pos: Vector2i, tekton_id: int, shape_idx: int):
# But we add a check to avoid duplicates if it already came in via sync.
if not has_node("Tekton_%d" % tekton_id):
_create_tekton(pos, tekton_id, true)
# Force Tekton height UP to sit on stand on ALL peers
var tekton = get_node_or_null("Tekton_%d" % tekton_id)
if tekton:
var height_offset = 0.6
# If Sphere (Index 3), it is taller (Dome)
if shape_idx == 3:
height_offset = 1.3
tekton.position.y += height_offset