Physics Jump-Through

Get help using Construct 2

Post » Sun Feb 24, 2013 8:56 am

Hi all - I'm making a platformer and it's made entirely out of physics. I have a bunch of background objects which I want the player to be able to run through while at the same time be able to jump ontop of - is there a way to check if the player is above an object and to enable disable collisions accordingly?

One potential problem is that the objects can be rotated freely, so the 'top' of the object might change.

All the background objects are part of the same sprite - I've tried a few things with for each and pick all and I just can't work it out.

My character is set up so that it has a physics base wheel and body and also a 'ground detector'

I've made a little video showing where it is at currently: [TUBE]yOPZsBr84Us[/TUBE]
Best,
Mik
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sun Feb 24, 2013 2:23 pm

I'm not sure exactly how this will play into your physics mechanisms, but the Jump-thru behaviour handles pretty much exactly what you want here. It even accounts for moving/rotated sprites. If you could find a way to make it work with your physics stuff then it might save you a lot of hassle.

Quick example capx using platform behaviour: right click to rotate the blocks, left click to drag and drop.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Sun Feb 24, 2013 2:43 pm

Well , The logic is simple enough ... Every object below the player should be solid and every object ontop non-solid ... I currently don't have access to C2 , so that's the only thing I can do to help you ...

Cheers , and Good Luck ...

Edit : You could place the origin of the player at the bottom of his sprite and the origins of each objects at the top of their respective spritesWhiteclaws2013-02-24 14:50:38
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sun Feb 24, 2013 2:49 pm

It'll probably be pretty difficult to implement this, but in my mind it's rather unnatural and may feel strange to the player. Just my opinion ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Feb 24, 2013 3:30 pm

THanks for the suggestions - I've actually decided it's too complex so have given the objects two states, normal where it ignores collision and active, active state is for when in zero gravity.

Thanks guys
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sun Feb 24, 2013 3:44 pm

Don't abandon this fast ^^
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sun Feb 24, 2013 4:59 pm

haha it's not that, this way is just better design I think from re-evaluating the problem. It's simpler, which is often better in my experience.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests