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

Get help using Construct 2

Post » Mon Jan 05, 2015 5:52 am

Message: arrjayjee can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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.

https://www.youtube.com/watch?v=FO8IcvmYpJs#t=240
B
5
Posts: 36
Reputation: 397

Post » Mon Jan 05, 2015 7:39 am

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)
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Mon Jan 05, 2015 8:45 am

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 ;)
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Mon Jan 05, 2015 8:53 am

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...
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542


Return to How do I....?

Who is online

Users browsing this forum: Fradno, marcinkowski, tarek2 and 9 guests