![]() You may also want to set a slope cutoff above which platforms are simply treated as walls, and cannot be jumped through. Also, simply checking the vertical component of the character's velocity is not always correct for highly tilted platforms what you really need to test is the vector dot product between the character's velocity and the platform's (upward-pointing) surface normal. First, when the character is running uphill along a platform, you obviously don't want them to sink into it this may require separate treatment of running/standing characters as opposed to jumping ones. Note that, if your platforms are not always perfectly horizontal, you'll need to take some extra care. ![]() There are (at least) two ways to handle that situation: either ignore collisions with platforms which the character already overlaps (which causes them to just fall back down if they didn't jump high enough to fully clear the platform) or detect such overlaps and move the character up until they're standing on the platform, perhaps accompanied by a special grabbing and climbing animation. If your platforms (or character) have a non-negligible thickness, you may need to deal with the situation where the character partially overlaps a platform at the top of their jump. I'm not familiar with AndEngine, but the obvious general approach is to turn off collisions between the character and platforms whenever the character's vertical velocity is positive (i.e. ![]()
0 Comments
Leave a Reply. |