feat: Implement core game logic, player script, and the Stop n Go game mode with its dedicated manager.
This commit is contained in:
+18
-5
@@ -935,12 +935,22 @@ func on_stop_phase_violation():
|
||||
# New Indefinite Freeze until phase ends
|
||||
rpc("sync_stop_freeze", true)
|
||||
|
||||
# Scatter items
|
||||
var items_to_scatter = []
|
||||
# Scatter only 3 random items (User request)
|
||||
var occupied_indices = []
|
||||
for i in range(playerboard.size()):
|
||||
if playerboard[i] != -1:
|
||||
items_to_scatter.append(playerboard[i])
|
||||
playerboard[i] = -1
|
||||
occupied_indices.append(i)
|
||||
|
||||
if occupied_indices.is_empty(): return
|
||||
|
||||
occupied_indices.shuffle()
|
||||
var scatter_count = min(occupied_indices.size(), 3)
|
||||
var items_to_scatter = []
|
||||
|
||||
for i in range(scatter_count):
|
||||
var idx = occupied_indices[i]
|
||||
items_to_scatter.append(playerboard[idx])
|
||||
playerboard[idx] = -1
|
||||
|
||||
rpc("sync_playerboard", playerboard)
|
||||
|
||||
@@ -2006,7 +2016,10 @@ func _highlight_adjacent_playerboard_slots():
|
||||
|
||||
@rpc("any_peer", "call_local", "reliable")
|
||||
func sync_rotation(new_rotation: float):
|
||||
if not is_multiplayer_authority():
|
||||
# Apply rotation if we are NOT the authority (syncing others)
|
||||
# OR if the server (ID 1) is forcing a rotation (start of match)
|
||||
var sender_id = multiplayer.get_remote_sender_id()
|
||||
if not is_multiplayer_authority() or sender_id == 1:
|
||||
rotation.y = new_rotation
|
||||
if movement_manager:
|
||||
movement_manager.target_rotation = new_rotation
|
||||
|
||||
Reference in New Issue
Block a user