[Solved] Reliable ledge-grab

Get help using Construct 2

Post » Thu Apr 25, 2013 6:41 pm

Trying to figure out the best way method for ledge-grabbing. Currently I'm using a 2x2 detector and when it overlaps a solid, yet isn't overlapping a solid at 0,-2, the player grabs the ledge. Problem is it doesn't work well when falling at high speeds and sometimes activates when falling along a wall. I understand why..just not sure how to fix it :L

I've looked at some examples around the forums but they seem to have the same issues.. Any ideas?Tokinsom2013-04-25 22:31:53
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Apr 25, 2013 8:58 pm

You could have a condition stating if the player was overlapping a solid on an offset, to turn off it's platform behavior.

I'll try to upload a cap later today when I can. Managed to do it without using any extra sprites other than the player and collision.
B
37
S
6
G
6
Posts: 45
Reputation: 4,502

Post » Thu Apr 25, 2013 10:32 pm

Got it working by removing some unnecessary conditions ^^;
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Apr 25, 2013 10:59 pm

Rockwell, I'd still be interested in seeing what you were working on. I've been experimenting with several different ledge grab methods. Haven't yet found one I really like.
B
8
S
3
G
1
Posts: 16
Reputation: 1,341

Post » Thu Apr 25, 2013 11:00 pm

Awww damnit! I spent the last 3 hours coding up a Flashback clone just for you! ;p

Glad you got it sorted though. So the detector falling with the player at high speeds was ok?
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Fri Apr 26, 2013 4:22 am

Edge Grabbing Example

Can definitely be tweaked but it's a general idea. Increasing the collision offset gives more leeway to grab on. You can also walk off an edge and grab back on if you quickly reverse your direction in the air. Should be able to grab on while both jumping and falling.
B
37
S
6
G
6
Posts: 45
Reputation: 4,502

Post » Fri Apr 26, 2013 4:46 am

@procrastinator Well the player grabs the ledge every time now but it's not perfect.. your .capx might still be useful!

@Rockwell Will check out the example soon, I have to update C2 first.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Apr 26, 2013 4:55 am

Thanks to everyone who provided feedback here. Working through different methods of doing things is just going to help people make better games.

/respect
B
8
S
3
G
1
Posts: 16
Reputation: 1,341

Post » Fri Apr 26, 2013 10:41 pm

@Tokinsom, ah I was just pissing about with the Flashback clone ;p Good to know it works. Working imperfectly is better than not working at all! I might have a bash over the weekend to check fast moving objects as I've never had the need to check those. Working on a game now that may require it though so who knows.. ;)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests