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:
@@ -20,6 +20,7 @@ class_name BallsBase extends Node3D
|
||||
|
||||
var balls_moving: bool = false
|
||||
|
||||
|
||||
func _set_ball_physics(ball: RigidBody3D) -> void:
|
||||
var phy_mat = PhysicsMaterial.new()
|
||||
|
||||
@@ -29,11 +30,16 @@ func _set_ball_physics(ball: RigidBody3D) -> void:
|
||||
|
||||
ball.set_physics_material_override(phy_mat)
|
||||
|
||||
ball.axis_lock_linear_y = true
|
||||
ball.axis_lock_linear_y = true
|
||||
ball.set_mass(ball_mass)
|
||||
ball.set_linear_damp(2.04)
|
||||
ball.set_angular_damp(1.44)
|
||||
|
||||
ball.set_use_continuous_collision_detection(true)
|
||||
ball.contact_monitor = true
|
||||
# NOTE: How many balls can surround a single ball,
|
||||
# therefor worst case is 6 collisions. (think start of game)
|
||||
ball.max_contacts_reported = 6
|
||||
|
||||
ball.body_entered.connect(_on__ball_body_entered)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user