Files
Billiards/controllers/game/modes/game_manager_base.gd
itdominator b931ef5a01 feat(game): improve mode state handling and active player UI
* Rename and consolidate ball state tracking across game modes
* Add ball finalization and win-condition hooks
* Track foul points by negating reaped ball points
* Update turn switching and ball processing flow
* Add active-player indicator to the camera controller UI
* Refresh active-player label when the turn changes
2026-08-12 21:38:49 -05:00

26 lines
680 B
GDScript

class_name GamManagerBase extends Node
@export var mode: BaseMode
@onready var pool_table_manager: PoolTableManager = $"../pool_table_manager"
func _balls_stopped_moving() -> void:
if pool_table_manager.white_ball_sunk or pool_table_manager.white_ball_hard_sunk:
pool_table_manager.initial_white_ball_start()
if pool_table_manager.white_ball_hard_sunk:
pool_table_manager.balls.white_ball.set_visible(true)
mode.handle_switch_user()
return
pool_table_manager.align_to_white_ball()
mode.handle_switch_user()
func set_mode(game_mode) -> void:
mode = Globals.game_data.GameMode.get(game_mode).new()
mode.ball_states = mode.generate_ball_states()