Reordered shot setup

This commit is contained in:
Rob Kelly 2024-11-04 15:17:32 -07:00
parent b0551df391
commit bd417cb374
1 changed files with 32 additions and 32 deletions

View File

@ -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