From bd417cb3748eecf69a66645e3eab16778e62ab76 Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Mon, 4 Nov 2024 15:17:32 -0700 Subject: [PATCH] Reordered shot setup --- src/player/shot_setup/shot_setup.gd | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/player/shot_setup/shot_setup.gd b/src/player/shot_setup/shot_setup.gd index c93a1f1..b11c74c 100644 --- a/src/player/shot_setup/shot_setup.gd +++ b/src/player/shot_setup/shot_setup.gd @@ -135,38 +135,6 @@ func take_shot() -> void: physics_ball.apply_central_impulse(impulse.rotated(Vector3.UP, -PI / 2.0)) -func _on_phase_change(new_phase: Phase) -> void: - match new_phase: - Phase.AIM: - arrow_animation.play("show") - camera.make_current() - power_bar.hide() - curve_bar.hide() - Phase.POWER_ADJUST: - curve_bar.hide() - - power_bar.show() - power_animation.stop() # Reset if needed - Phase.CURVE_ADJUST: - curve_bar.show() - curve_animation.play("fill") - Phase.SHOT: - power_bar.hide() - curve_bar.hide() - - nice_animation.play("display") - - if not driving_range: - shot_animation.play("shoot") - arrow_animation.play("hide") - take_shot() - Phase.FINISHED: - power_bar.hide() - curve_bar.hide() - end_shot_track() - travel_to_ball() - - func insert_free_cam() -> void: arrow_animation.play("hide") _free_camera = FreeCamera.create(camera) @@ -220,6 +188,38 @@ func end_shot_track() -> void: #tracking_camera.active = false +func _on_phase_change(new_phase: Phase) -> void: + match new_phase: + Phase.AIM: + arrow_animation.play("show") + camera.make_current() + power_bar.hide() + curve_bar.hide() + Phase.POWER_ADJUST: + curve_bar.hide() + + power_bar.show() + power_animation.stop() # Reset if needed + Phase.CURVE_ADJUST: + curve_bar.show() + curve_animation.play("fill") + Phase.SHOT: + power_bar.hide() + curve_bar.hide() + + nice_animation.play("display") + + if not driving_range: + shot_animation.play("shoot") + arrow_animation.play("hide") + take_shot() + Phase.FINISHED: + power_bar.hide() + curve_bar.hide() + end_shot_track() + travel_to_ball() + + func _process(delta: float) -> void: ## Visual updates # Rotation