Platformer wall handling at marginal angles

0 favourites
  • 11 posts
From the Asset Store
Wall Pin Board is a hyper causal game developed for fun and inspired by YouTube video whose link is given in description
  • I've noticed something that's rather irritating about the platform behavior.

    capx here.

    <img src="" border="0">

    Basically, if you have a vertical wall at a tiny angle, and the player is pushed up against it, it can either be climbed, or the player won't be able to jump at all.

    Any suggestions or ideas as to how I can get around this?


  • Other than saying set them to 0 degrees, what were you expecting to happen?

  • why dont you make a solid wall that is completely straight on the edges, set it invisible and put an image over top of it that has various angles that is not solid??

    I posted my response assuming you are trying to avoid your player being able to climb up a wall--so if that wasn't what you meant, sorry.

  • The angled walls are unavoidable, otherwise I'd just make them straight.

  • stop on collision?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The only way I could see around it is to have an invisible overlapping 'helper' sprite, like you're already using to create gravity zones, and have it mimic jumping, where jumping doesn't trigger naturally ( on the overhangs ) by applying velocity to vectorY at jump strength, or, disabling jump/vector Y, where it's a steep incline.

  • The angled walls are unavoidable, otherwise I'd just make them straight.

    The question is still: what do you want to happen?

    Also those are opposite sides of the angle(right side points up, left points down), so the way it is is not unexpected.

  • newt ideally the jump would appear normal (like a perfectly vertical wall). So no climbing or getting stuck.

  • For a very rough solution (there's definitely some room for refinement), I'd suggest using two events to push the player away slightly:

    Is Player overlapping Wall at offset (-1,0) -> Player Set x to self.x+1

    Is Player overlapping Wall at offset (1,0) -> Player Set x to self.x-1

    I'd also suggest adding in a condition to check the wall's angle, otherwise the player vibrates while pushing against flat walls.

  • GeometriX the player will also vibrate when pushing against non-flat walls, and it doesn't actually fix the problem anyway :P

  • It definitely prevents climbing. Getting stuck under overhanging ledges would just require a bit more fiddling of that same concept, I'd think (checking on which side of the player the wall is, then check that wall's angle, and check if the player is jumping or attempting to).

    Here's a capx for a more refined version of what I suggested before. The only thing that doesn't look great is if the player stands inside an overhang and mashes jump while holding in the direction key against the wall, which is pretty atypical player behaviour anyway. You can always extend the push by a few more pixels to alleviate this, but it depends on the animations you've got and how twitchy that'll look. If the player lets go of the direction key while pressing jump, it'll look great, though.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)