feat: Implement core multiplayer features including user authentication, profile management, lobby, game mode managers, and leaderboard.
This commit is contained in:
@@ -17,7 +17,6 @@ var doors = [] # List of PortalDoor nodes
|
||||
var swap_timer: Timer
|
||||
var tile_refresh_timer: Timer
|
||||
var finish_spawned: bool = false
|
||||
var missions_required: int = 8
|
||||
var arena_setup_done: bool = false
|
||||
var player_portal_cooldowns: Dictionary = {}
|
||||
|
||||
@@ -41,6 +40,7 @@ func initialize(p_main: Node, p_gridmap: Node):
|
||||
# Connection Swap Timer (15s)
|
||||
swap_timer = Timer.new()
|
||||
swap_timer.name = "PortalSwapTimer"
|
||||
# Initial wait time; gets reset when started based on game mode settings
|
||||
swap_timer.wait_time = 15.0
|
||||
swap_timer.timeout.connect(_on_swap_timer_timeout)
|
||||
add_child(swap_timer)
|
||||
@@ -48,6 +48,7 @@ func initialize(p_main: Node, p_gridmap: Node):
|
||||
# Tile Refresh Timer (25s)
|
||||
tile_refresh_timer = Timer.new()
|
||||
tile_refresh_timer.name = "TileRefreshTimer"
|
||||
# Initial wait time; gets reset when started based on game mode settings
|
||||
tile_refresh_timer.wait_time = 25.0
|
||||
tile_refresh_timer.timeout.connect(_on_tile_refresh_timer_timeout)
|
||||
add_child(tile_refresh_timer)
|
||||
@@ -77,6 +78,10 @@ func start_game_mode():
|
||||
setup_arena_locally()
|
||||
_randomize_connections()
|
||||
|
||||
# Configure dynamic timings from LobbyManager before starting
|
||||
swap_timer.wait_time = float(LobbyManager.doors_swap_time)
|
||||
tile_refresh_timer.wait_time = float(LobbyManager.doors_refresh_time)
|
||||
|
||||
# Start Timers
|
||||
if swap_timer.is_stopped():
|
||||
swap_timer.start()
|
||||
@@ -176,9 +181,9 @@ func _update_hud_visuals():
|
||||
var gcm = main.get_node_or_null("GoalsCycleManager")
|
||||
var completed_count = gcm.player_goal_counts.get(my_id, 0) if gcm else 0
|
||||
|
||||
mission_label.text = "GOALS (%d/%d)" % [completed_count, missions_required]
|
||||
mission_label.text = "GOALS (%d/%d)" % [completed_count, LobbyManager.doors_required_goals]
|
||||
|
||||
if completed_count >= missions_required:
|
||||
if completed_count >= LobbyManager.doors_required_goals:
|
||||
mission_label.text = "ALL GOALS COMPLETE!\nFIND THE FINISH ROOM!"
|
||||
mission_label.add_theme_color_override("font_color", Color.GOLD)
|
||||
|
||||
@@ -194,7 +199,7 @@ func _update_hud_visuals():
|
||||
func is_mission_complete(peer_id: int) -> bool:
|
||||
var gcm = main.get_node_or_null("GoalsCycleManager")
|
||||
if not gcm: return false
|
||||
return gcm.player_goal_counts.get(peer_id, 0) >= missions_required
|
||||
return gcm.player_goal_counts.get(peer_id, 0) >= LobbyManager.doors_required_goals
|
||||
|
||||
func check_win_condition(player_id: int, pos: Vector2i) -> bool:
|
||||
# 1. Check if on finish tile
|
||||
|
||||
Reference in New Issue
Block a user