mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
Progressively interrupt the jump in the 2D platformer demo
This feels more smooth while still giving a sense of control to the player.
This commit is contained in:
@@ -94,7 +94,9 @@ func calculate_move_velocity(
|
||||
if direction.y != 0.0:
|
||||
velocity.y = speed.y * direction.y
|
||||
if is_jump_interrupted:
|
||||
velocity.y = 0.0
|
||||
# Decrease the Y velocity by multiplying it, but don't set it to 0
|
||||
# as to not be too abrupt.
|
||||
velocity.y *= 0.6
|
||||
return velocity
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user