V4 lab drops
This commit is contained in:
1 parent
aeb5b324f1
commit
f1363dd6c8
11 files changed
+157
-37
No files matched your search
+10
-4
@@ -301,10 +301,7 @@ func _handle_horizontal_movement(delta: float) -> void:
|
||||
facing_direction = signf(direction)
|
||||
_update_facing()
|
||||
|
||||
var move_speed: float = character_data.move_speed
|
||||
if _speed_boost_timer > 0.0:
|
||||
move_speed *= (1.0 + _speed_boost_multiplier)
|
||||
var target_speed: float = direction * move_speed
|
||||
var target_speed: float = direction * get_move_speed()
|
||||
|
||||
if ground_pound_active:
|
||||
target_speed *= ground_pound_horizontal_control
|
||||
@@ -333,6 +330,15 @@ func _handle_horizontal_movement(delta: float) -> void:
|
||||
velocity.x = move_toward(velocity.x, target_speed, air_acceleration * delta)
|
||||
|
||||
|
||||
## Horizontal running speed with active pickups applied. Keeping the HUD and
|
||||
## movement on the same calculation avoids showing a bonus that isn't used.
|
||||
func get_move_speed() -> float:
|
||||
if character_data == null:
|
||||
return 0.0
|
||||
var bonus: float = _speed_boost_multiplier if _speed_boost_timer > 0.0 else 0.0
|
||||
return character_data.move_speed * (1.0 + bonus)
|
||||
|
||||
|
||||
func _update_facing() -> void:
|
||||
animated_sprite.flip_h = facing_direction < 0.0
|
||||
|
||||
|
||||
Reference in new issue
Block a user