feat: Implement Stop N Go game mode with phase management, mission objectives, and visual HUD elements.

This commit is contained in:
Yogi Wiguna
2026-02-26 10:40:55 +08:00
parent 36485c7f25
commit 3cd67c02ab
6 changed files with 127 additions and 44 deletions
+15
View File
@@ -120,6 +120,9 @@ func refresh_room_list() -> void:
func set_ready(is_ready: bool) -> void:
"""Set local player's ready state."""
if not multiplayer.has_multiplayer_peer():
return
var my_id = multiplayer.get_unique_id()
# Update local state
@@ -248,6 +251,10 @@ func set_character(character_name: String) -> void:
return
local_character_index = idx
if not multiplayer.has_multiplayer_peer():
return
var my_id = multiplayer.get_unique_id()
# Update local player data
@@ -289,6 +296,11 @@ func sync_character(player_id: int, character_name: String) -> void:
func set_player_name(new_name: String) -> void:
"""Set local player's name. Syncs to all peers."""
local_player_name = new_name
if not multiplayer.has_multiplayer_peer():
emit_signal("player_list_changed")
return
var my_id = multiplayer.get_unique_id()
# Update local player data
@@ -412,6 +424,9 @@ func _on_match_joined(match_id: String) -> void:
var short_id = match_id.substr(0, 8) if match_id.length() > 8 else match_id
current_room["room_name"] = short_id
if not multiplayer.has_multiplayer_peer():
return
# Add self to player list
var my_id = multiplayer.get_unique_id()
var my_data = {
+1 -1
View File
@@ -11,7 +11,7 @@ enum Phase {GO, STOP}
const GO_DURATION: float = 8.0
const STOP_DURATION: float = 4.0
const REQUIRED_GOALS: int = 8
const REQUIRED_GOALS: int = 1
var current_phase: Phase = Phase.GO
var phase_timer: float = GO_DURATION