waterpole improvements

This commit is contained in:
Haze Weathers 2025-02-26 04:01:29 -05:00
parent 9549acde6e
commit aa6b9cb4aa
6 changed files with 40 additions and 16 deletions

View file

@ -163,8 +163,10 @@ func _start_winning() -> void:
#region Pole Spinning
var _attached_pole: WatermanPole = null
var _pole_angle: float = 0.0
var _pole_stored_speed: float = 0.0
func _start_pole_spin() -> void:
_pole_stored_speed = flatten_vector(velocity).length()
velocity = Vector3.ZERO
var pole_xz = flatten_vector(_attached_pole.global_position)
var self_xz = flatten_vector(global_position)
@ -189,7 +191,7 @@ func _process_pole_spin(delta: float) -> void:
func _end_pole_spin() -> void:
var pole_xz = flatten_vector(_attached_pole.global_position)
var impulse = Vector3.FORWARD.rotated(Vector3.UP, _pole_angle) * _attached_pole.release_boost
var impulse = Vector3.FORWARD.rotated(Vector3.UP, _pole_angle) * _pole_stored_speed
velocity.x = impulse.x
velocity.z = impulse.z
#endregion