generated from krampus/template-godot4
Reordered shot setup
This commit is contained in:
parent
b0551df391
commit
bd417cb374
|
@ -135,38 +135,6 @@ func take_shot() -> void:
|
||||||
physics_ball.apply_central_impulse(impulse.rotated(Vector3.UP, -PI / 2.0))
|
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:
|
func insert_free_cam() -> void:
|
||||||
arrow_animation.play("hide")
|
arrow_animation.play("hide")
|
||||||
_free_camera = FreeCamera.create(camera)
|
_free_camera = FreeCamera.create(camera)
|
||||||
|
@ -220,6 +188,38 @@ func end_shot_track() -> void:
|
||||||
#tracking_camera.active = false
|
#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:
|
func _process(delta: float) -> void:
|
||||||
## Visual updates
|
## Visual updates
|
||||||
# Rotation
|
# Rotation
|
||||||
|
|
Loading…
Reference in New Issue