feat: introduce Stop N Go game mode with phase management, dynamic arena setup, and goal tracking.
This commit is contained in:
+7
-2
@@ -249,8 +249,8 @@ func broadcast_message(player_name: String, message: String):
|
|||||||
|
|
||||||
func _setup_global_match_timer_ui():
|
func _setup_global_match_timer_ui():
|
||||||
"""Create the global match timer display at the top of the screen."""
|
"""Create the global match timer display at the top of the screen."""
|
||||||
# Check if timer check is enabled in lobby settings
|
# Check if timer check is enabled in lobby settings OR if in Stop n Go mode
|
||||||
if not LobbyManager.enable_cycle_timer:
|
if not LobbyManager.enable_cycle_timer and LobbyManager.game_mode != "Stop n Go":
|
||||||
var existing = get_node_or_null("GlobalMatchTimer")
|
var existing = get_node_or_null("GlobalMatchTimer")
|
||||||
if existing:
|
if existing:
|
||||||
existing.visible = false
|
existing.visible = false
|
||||||
@@ -563,6 +563,11 @@ func _start_game():
|
|||||||
# Only Server starts the mode logic (arena setup, missions, etc)
|
# Only Server starts the mode logic (arena setup, missions, etc)
|
||||||
if stop_n_go_manager:
|
if stop_n_go_manager:
|
||||||
stop_n_go_manager.start_game_mode()
|
stop_n_go_manager.start_game_mode()
|
||||||
|
|
||||||
|
# Also start global match timer for Stop n Go
|
||||||
|
if goals_cycle_manager:
|
||||||
|
var match_duration = LobbyManager.get_match_duration()
|
||||||
|
goals_cycle_manager.start_match(float(match_duration), false) # No cycles for Stop n Go
|
||||||
elif goals_cycle_manager:
|
elif goals_cycle_manager:
|
||||||
var match_duration = LobbyManager.get_match_duration()
|
var match_duration = LobbyManager.get_match_duration()
|
||||||
goals_cycle_manager.start_match(float(match_duration))
|
goals_cycle_manager.start_match(float(match_duration))
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ func _process(delta):
|
|||||||
# Global Match Control
|
# Global Match Control
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
func start_match(duration_seconds: float):
|
func start_match(duration_seconds: float, start_cycles: bool = true):
|
||||||
"""Start the global match timer. Called by server when game starts."""
|
"""Start the global match timer. Called by server when game starts."""
|
||||||
match_duration = duration_seconds
|
match_duration = duration_seconds
|
||||||
global_match_timer = duration_seconds
|
global_match_timer = duration_seconds
|
||||||
@@ -103,8 +103,9 @@ func start_match(duration_seconds: float):
|
|||||||
|
|
||||||
if multiplayer.is_server():
|
if multiplayer.is_server():
|
||||||
rpc("sync_match_start", duration_seconds)
|
rpc("sync_match_start", duration_seconds)
|
||||||
# Also start the first cycle
|
# Only start the first cycle if requested
|
||||||
start_cycle()
|
if start_cycles:
|
||||||
|
start_cycle()
|
||||||
|
|
||||||
func _on_match_end():
|
func _on_match_end():
|
||||||
"""Called when global match timer reaches zero - game over!"""
|
"""Called when global match timer reaches zero - game over!"""
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ signal player_penalized(player_id: int)
|
|||||||
|
|
||||||
enum Phase {GO, STOP}
|
enum Phase {GO, STOP}
|
||||||
|
|
||||||
const GO_DURATION: float = 12.0
|
const GO_DURATION: float = 8.0
|
||||||
const STOP_DURATION: float = 6.0
|
const STOP_DURATION: float = 4.0
|
||||||
const REQUIRED_GOALS: int = 2
|
const REQUIRED_GOALS: int = 2
|
||||||
|
|
||||||
var current_phase: Phase = Phase.GO
|
var current_phase: Phase = Phase.GO
|
||||||
|
|||||||
Reference in New Issue
Block a user