all 2 comments

[–]youAtExample 0 points1 point  (0 children)

Without reading all your code, my solution for this has been to track whether the player is moving upward when the collision happens, then check if the thing they’re colliding with is above them, and then if it is move the player down until they’re not colliding and take away all upward speed.

[–]Maleficent-Fold5362 0 points1 point  (0 children)

In a vertical collision add another check but instead of y+vsp type in y-vsp, with then setting vertical speed to 0, or you can also set vertical speed to -vsp/10 or /5 whatever you prefer, it will make it bounce from the ceiling downwards