* Replace `valid_end` with `is_foul` for invalid ball sinks * Rename and centralize ball state tracking * Add ball finalization and win-condition hooks * Update turn switching to retain the player after valid sinks * Apply negative points to reaped balls * Add active-player indicator to the camera UI * Emit active-player updates when the turn changes
26 lines
680 B
GDScript
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()
|