How do I make a platform character stick to walls and roof?

  • I'm making a platform game and I want the character to be able to stick to the walls and the roof and then unlatch from the stickiness with the jump button. Any ideas on how this could be accomplished as simply as possible?

    Kind of like the Spider Ball from Metroid 2, if that helps you understand it. Here's a link to a YouTube video that shows the kind of "wall crawling" movement I'm after.

    youtube.com/watch

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Platform behavior objects can use "has a wall (to left or right)" condition. You can use that combined with a key press condition. Check if it works with gravity or with no gravity.

    Note that platform objects will still fall down even if gravity = 0 if not on top of solid or jump thru. Set Vector Y = 0 to stop moving vertically (though you want to go up or down when beside a wall, so you probably don't need this)

  • The game I am developing actually does what you ask -> http://youtu.be/EfZcmWmxIUs

    The simplest way for you to do it is to make the player a physics object. Then on a collision with an object you just turn off the physics. In my game things get more complicated as I need to detect which side has collided to know how I should rotate the player. I'm not sure if you need to do that though

  • ok, so was just able to watch the spiderball video and it's a bit trickier if you want to move along the surfaces. In this case you could switch the gravity direction perhaps using rexrainbow's gravitation plugin (https://www.scirra.com/forum/viewtopic.php?f=153&t=70521&hilit=gravity) when you detect which side of the player has collided.

    Many ways to skin a cat here though...

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