You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple check and works well, but it has one quirk: if the player doesn't jump high enough to reach the platform he ends up halfway and the moment the velocity starts inverting its direction (because of gravity) a collision is generated and an impulse is calculated "fixing" his position abruptly.
This is due to the way I'm implementing the check to block (or not) the player while it jumps on a one-way platform from below.
Here (https://github.com/passiomatic/sunny-land/blob/main/src/Physics.elm#L284) I'm projecting the player velocity along the wall normal and see if they have the same direction. If this is the case the player is coming from behind/below the wall and the game doesn't block him.
This is a simple check and works well, but it has one quirk: if the player doesn't jump high enough to reach the platform he ends up halfway and the moment the velocity starts inverting its direction (because of gravity) a collision is generated and an impulse is calculated "fixing" his position abruptly.
Fix: use code from https://github.com/passiomatic/platformer-physics
The text was updated successfully, but these errors were encountered: