feat(game): add free ball mode and improve ball state handling
* add Free Ball game mode and lobby selection * refactor base mode ball state tracking for reaped/sunk balls * add player ownership tracking and colored-ball support * add initial 9-ball mode implementation * update 8-ball and snooker modes to use base ball handling * replicate ball linear velocity for multiplayer synchronization * improve ball collision sound propagation and physics settings * reenable game music and initialize game signals * improve lobby input focus and mode selection behavior * adjust cue impulse origin and default game mode
This commit is contained in:
@@ -2,24 +2,22 @@ class_name Ball8 extends BaseMode
|
||||
|
||||
|
||||
func reap_ball(ball: Node3D) -> void:
|
||||
balls_reaped.append(ball.name)
|
||||
super(ball)
|
||||
|
||||
if ball.name == "08_ball":
|
||||
# TODO: 8 ball must not be be destroyed. Handle rule...
|
||||
pass
|
||||
|
||||
ball_state[ball.name] = not ball_state[ball.name]
|
||||
|
||||
func process_ball(ball: Node3D) -> void:
|
||||
balls_sunk.append(ball.name)
|
||||
super(ball)
|
||||
|
||||
if ball.name == "08_ball":
|
||||
# TODO: 8 ball must be sunk last. Handle rule...
|
||||
pass
|
||||
|
||||
ball_state[ball.name] = not ball_state[ball.name]
|
||||
|
||||
func handle_switch_user() -> void:
|
||||
push_warning("Balls reaped: ", balls_reaped.size())
|
||||
push_warning("Balls sunk: ", balls_sunk.size())
|
||||
push_warning("Balls reaped: ", balls_reaped.size() )
|
||||
push_warning("Balls sunk: ", balls_sunk.size() )
|
||||
|
||||
if not balls_reaped.is_empty():
|
||||
# TODO: Handle points, etc
|
||||
|
||||
Reference in New Issue
Block a user