- Fall onto the ground, but not through it.
- Stand on the ground without jiggling all over the place.
- Jump off of the ground, but not be able to jump while in midair
- Walk on flat ground, on up slopes, and on down slopes, without losing contact with the ground, losing the ability to jump, or getting stuck transitioning between tiles
- Walk off of cliffs and correctly start falling again
Keeping your feet on the ground
I apologize for asking what seems like such a basic question; unfortunately, the search tool didn't aid me much. If you have any relevant links or threads, feel free to send me off with those.
Edit: this would probably be helpful. I'm working on a 2D platformer game here.
In short, I'm having problems with properly recognizing when an object is resting atop another object (e.g. something standing on terrain). I'm using convex bounding polygons and SAT to detect collisions, which gives me, on collision, the normal of the edge that was collided with, and the distance along that normal that must be moved to be no longer colliding. I can also get the distance along the sprite's velocity to push back, though that requires an additional call. I've come up with the following requirements that I can think of to get a reasonable interaction with terrain:
Quote:Original post by Derakon
if I do unset it, then I get jiggling problems, because on every frame, the player falls slightly into the terrain, and is pushed back out slightly, to a new and different location.
Jiggling? If it falls in slightly and is pushed out again every frame, I thought that would just result in it sliding down slopes. The obvious solution to that would be some friction. Then maybe you can play with the friction force a bit to make it walk around.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement