Platformer wall handling at marginal angles

Get help using Construct 2

Post » Mon Oct 14, 2013 10:29 pm

I've noticed something that's rather irritating about the platform behavior.

capx here.



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?

Thanks!sqiddster2013-10-14 22:30:12
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Oct 14, 2013 11:04 pm

Other than saying set them to 0 degrees, what were you expecting to happen?
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195

Post » Mon Oct 14, 2013 11:11 pm

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.honeben2013-10-14 23:14:26
B
19
S
6
G
3
Posts: 9
Reputation: 1,755

Post » Tue Oct 15, 2013 12:07 am

The angled walls are unavoidable, otherwise I'd just make them straight.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Oct 15, 2013 12:11 am

stop on collision?
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Tue Oct 15, 2013 12:15 am

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.

JohnnySix2013-10-15 00:15:50
Image
B
27
S
9
G
5
Posts: 488
Reputation: 11,948

Post » Tue Oct 15, 2013 1:03 am

[QUOTE=sqiddster] The angled walls are unavoidable, otherwise I'd just make them straight. [/QUOTE]



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.newt2013-10-15 01:04:10
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195

Post » Tue Oct 15, 2013 3:23 am

@newt ideally the jump would appear normal (like a perfectly vertical wall). So no climbing or getting stuck.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Oct 15, 2013 8:18 am

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.GeometriX2013-10-15 08:21:57
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Tue Oct 15, 2013 1:10 pm

@GeometriX the player will also vibrate when pushing against non-flat walls, and it doesn't actually fix the problem anyway :P
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Next

Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, SashikLV, unxcellent and 7 guests