2026-08-07 02:50:54 -05:00
|
|
|
class_name GameManager extends GamManagerMultiplayer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
setup_signals()
|
|
|
|
|
setup_multiplayer()
|
|
|
|
|
|
|
|
|
|
func setup_signals() -> void:
|
|
|
|
|
Globals.game_state.balls_stopped_moving.connect(_balls_stopped_moving)
|
|
|
|
|
Globals.game_state.reap_ball.connect(_reap_ball)
|
2026-08-10 21:22:52 -05:00
|
|
|
Globals.game_state.process_ball.connect(_process_ball)
|
2026-08-07 02:50:54 -05:00
|
|
|
|
2026-08-10 21:22:52 -05:00
|
|
|
|
|
|
|
|
func _reap_ball(ball: Node3D) -> void:
|
2026-08-07 02:50:54 -05:00
|
|
|
if ball.name == "white_ball":
|
2026-08-10 21:22:52 -05:00
|
|
|
Globals.game_state.white_ball_needs_hard_reset.emit()
|
2026-08-07 02:50:54 -05:00
|
|
|
return
|
|
|
|
|
|
2026-08-10 21:22:52 -05:00
|
|
|
mode.reap_ball(ball)
|
2026-08-07 02:50:54 -05:00
|
|
|
rpc("reap_ball", str(ball.get_path()))
|
|
|
|
|
|
2026-08-10 21:22:52 -05:00
|
|
|
func _process_ball(ball: Node3D) -> void:
|
2026-08-07 02:50:54 -05:00
|
|
|
if ball.name == "white_ball":
|
2026-08-10 21:22:52 -05:00
|
|
|
# NOTE: Signal to reset 'white_ball' to 'white_ball_marker' global_pos
|
|
|
|
|
Globals.game_state.white_ball_sunk.emit()
|
2026-08-07 02:50:54 -05:00
|
|
|
return
|
|
|
|
|
|
2026-08-10 21:22:52 -05:00
|
|
|
mode.process_ball(ball)
|
2026-08-07 02:50:54 -05:00
|
|
|
rpc("reap_ball", str(ball.get_path()))
|