push project up sabs assets
This commit is contained in:
35
controllers/game/modes/snooker.gd
Normal file
35
controllers/game/modes/snooker.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
class_name Snooker extends BaseMode
|
||||
|
||||
|
||||
func reap_ball(ball: Node3D) -> void:
|
||||
balls_reaped.append(ball.name)
|
||||
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)
|
||||
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())
|
||||
|
||||
if not balls_reaped.is_empty():
|
||||
# TODO: Handle points, etc
|
||||
balls_reaped.clear()
|
||||
|
||||
if balls_sunk.is_empty():
|
||||
Globals.game_state.switch_active_player()
|
||||
return
|
||||
|
||||
# TODO: Handle points, etc
|
||||
# Globals.multiplayer_data.current_turn_player_id
|
||||
|
||||
balls_sunk.clear()
|
||||
Reference in New Issue
Block a user