Skip to content

Commit b99cd95

Browse files
authored
Merge pull request #494 from Calinou/2d-platformer-progressive-jump-interrupt
Progressively interrupt the jump in the 2D platformer demo
2 parents 8823628 + 79ad34d commit b99cd95

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

2d/platformer/src/Actors/Player.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ func calculate_move_velocity(
9494
if direction.y != 0.0:
9595
velocity.y = speed.y * direction.y
9696
if is_jump_interrupted:
97-
velocity.y = 0.0
97+
# Decrease the Y velocity by multiplying it, but don't set it to 0
98+
# as to not be too abrupt.
99+
velocity.y *= 0.6
98100
return velocity
99101

100102

0 commit comments

Comments
 (0)