feat: Add initial main scene with grid map, UI, touch controls, and core game logic scripts.
This commit is contained in:
+5
-15
@@ -697,13 +697,16 @@ func _create_tekton(pos: Vector2i, tekton_id: int, is_static: bool = false):
|
|||||||
add_child(tekton)
|
add_child(tekton)
|
||||||
|
|
||||||
# Initialize
|
# Initialize
|
||||||
|
if is_static:
|
||||||
|
tekton.is_static_turret = true
|
||||||
|
|
||||||
if tekton.has_method("initialize"):
|
if tekton.has_method("initialize"):
|
||||||
if has_node("EnhancedGridMap"):
|
if has_node("EnhancedGridMap"):
|
||||||
tekton.initialize(pos, $EnhancedGridMap)
|
tekton.initialize(pos, $EnhancedGridMap)
|
||||||
|
|
||||||
# If Static, swap controller
|
# If Static, swap controller
|
||||||
if is_static:
|
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")
|
var old_controller = tekton.get_node_or_null("TektonController")
|
||||||
if old_controller:
|
if old_controller:
|
||||||
@@ -760,10 +763,7 @@ func spawn_static_tektons():
|
|||||||
# Pick Shape on Server (0:Cyl, 1:Box, 2:Prism, 3:Sphere)
|
# Pick Shape on Server (0:Cyl, 1:Box, 2:Prism, 3:Sphere)
|
||||||
var shape_idx = randi() % 4
|
var shape_idx = randi() % 4
|
||||||
|
|
||||||
# Spawn on Server
|
# Spawn on Server AND Sync to Clients (call_local handles both)
|
||||||
_create_static_setup(pos, id, shape_idx)
|
|
||||||
|
|
||||||
# Sync to Clients
|
|
||||||
rpc("sync_spawn_static_setup", pos, id, shape_idx)
|
rpc("sync_spawn_static_setup", pos, id, shape_idx)
|
||||||
|
|
||||||
@rpc("call_local", "reliable")
|
@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.
|
# But we add a check to avoid duplicates if it already came in via sync.
|
||||||
if not has_node("Tekton_%d" % tekton_id):
|
if not has_node("Tekton_%d" % tekton_id):
|
||||||
_create_tekton(pos, tekton_id, true)
|
_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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ columns = 14
|
|||||||
rows = 14
|
rows = 14
|
||||||
floors = 2
|
floors = 2
|
||||||
auto_randomize = true
|
auto_randomize = true
|
||||||
immutable_items = null
|
|
||||||
metadata/_editor_floor_ = Vector3(0, 1, 0)
|
metadata/_editor_floor_ = Vector3(0, 1, 0)
|
||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=1200003163]
|
[node name="Camera3D" type="Camera3D" parent="." unique_id=1200003163]
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ func _update_mesh_from_index():
|
|||||||
|
|
||||||
var shapes = [
|
var shapes = [
|
||||||
_create_cylinder(),
|
_create_cylinder(),
|
||||||
_create_box(),
|
_create_box()
|
||||||
_create_sphere()
|
|
||||||
]
|
]
|
||||||
|
|
||||||
var idx = shape_index % shapes.size()
|
var idx = shape_index % shapes.size()
|
||||||
|
|||||||
+6
-1
@@ -42,7 +42,12 @@ func update_visual_position():
|
|||||||
|
|
||||||
# Side offset: place it near the edge
|
# Side offset: place it near the edge
|
||||||
# Using NW corner (+0.2, +0.2) instead of center (+0.5, +0.5)
|
# Using NW corner (+0.2, +0.2) instead of center (+0.5, +0.5)
|
||||||
position = Vector3(current_position.x + 0.2, floor_y, current_position.y + 0.2)
|
var offset = 0.2
|
||||||
|
if is_static_turret:
|
||||||
|
offset = 0.5
|
||||||
|
floor_y = 0.6
|
||||||
|
|
||||||
|
position = Vector3(current_position.x + offset, floor_y, current_position.y + offset)
|
||||||
|
|
||||||
func move_to(target_pos: Vector2i):
|
func move_to(target_pos: Vector2i):
|
||||||
if is_moving or is_carried or is_thrown: return
|
if is_moving or is_carried or is_thrown: return
|
||||||
|
|||||||
Reference in New Issue
Block a user