update logic for push
This commit is contained in:
+7
-5
@@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b7nxt2hc4kqp8"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b7nxt2hc4kqp8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5q6yekyk0tld" path="res://scenes/lobby.gd" id="1_lp6xi"]
|
||||
[ext_resource type="Theme" uid="uid://da337sh5qxi0s" path="res://assets/themes/ui_theme.tres" id="2_theme"]
|
||||
[ext_resource type="Texture2D" uid="uid://2d1ks5pmblc7" path="res://assets/graphics/main_menu/bg_back.png" id="3_q60fs"]
|
||||
|
||||
[node name="Lobby" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -13,14 +14,15 @@ grow_vertical = 2
|
||||
theme = ExtResource("2_theme")
|
||||
script = ExtResource("1_lp6xi")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.08, 0.12, 0.18, 1)
|
||||
texture = ExtResource("3_q60fs")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="MainMenuPanel" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
@@ -719,9 +721,9 @@ anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 464.0
|
||||
offset_top = -70.0
|
||||
offset_top = -93.0
|
||||
offset_right = -461.0
|
||||
offset_bottom = -21.0
|
||||
offset_bottom = -44.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
|
||||
@@ -721,6 +721,23 @@ func get_occupied_positions() -> Array:
|
||||
occupied.append(player.current_position)
|
||||
return occupied
|
||||
|
||||
# Helper to find which player is at a specific position
|
||||
func get_player_at_position(pos: Vector2i) -> Node3D:
|
||||
for player in get_tree().get_nodes_in_group("Players"):
|
||||
if player == self:
|
||||
continue
|
||||
|
||||
# Check current position
|
||||
if player.current_position == pos:
|
||||
return player
|
||||
|
||||
# Check target position if moving
|
||||
if player.is_player_moving and player.target_position == pos:
|
||||
return player
|
||||
|
||||
return null
|
||||
|
||||
|
||||
# Modify the select_spawn_point function to notify other clients
|
||||
func select_spawn_point(spawn_pos: Vector2i) -> bool:
|
||||
if not is_multiplayer_authority() or is_bot or spawn_point_selected:
|
||||
|
||||
Reference in New Issue
Block a user