Platform physics not behaving as expected

Get help using Construct 2

Post » Tue Jul 23, 2013 7:02 pm

I am trying to replicate the (very simple) jump physics from the Megaman games, using this thread as a reference: http://forums.tigsource.com/index.php?topic=22757.0

I thought I understood C2's platform behavior but I guess not; in this capx, the player moves 2 pixels off the ground, then very slowly comes back down, or hovers a pixel off the ground:
https://dl.dropboxusercontent.com/u/25752478/megaman.capx

I can't figure out what is going on. Please help.
B
12
S
3
Posts: 39
Reputation: 1,001

Post » Wed Jul 24, 2013 4:45 am

I haven't played the megaman game so I am guessing what effect you are trying to achieve. I suspect you want to modify the platform behaviour so that your gravity value is different depending on the height of the MM sprite - is this correct?

If not, then I've misunderstood and you are probably best just giving the MM sprite a gravity value and letting the platform plugin do its work for you.

If you do want to vary the gravity according to sprite height above the solid then you need to do something like this:

mm Set Platform Vector Y to: 50 + TiledBackground.Y - mm.Y

C2 platform behaviour doesn't seem to like small and changing values of gravity (hence the 50 minimum value in the above example). I tried to insert an image of the event and failed!

Hope this helps....Budgie2013-07-24 04:47:46
B
7
S
1
Posts: 11
Reputation: 599

Post » Wed Jul 24, 2013 7:35 pm

If you haven't played a megaman game, here's a good approximation of how the jump feels: http://www.scirra.com/arcade/example/4847/mega-man-engine-by-siksteen
(Press S to jump; there's no capx released unfortunately)

I implemented gravity manually because I'm not sure that C2's pixels/sec/sec gravity is the same as a constant change in velocity of 15pixels/sec.

It could be that the platform behavior doesn't like small numbers; it would require subpixel precision to implement the jump properly. Or maybe it's just the values I put in? I'm comparing it to the thread I linked in the first post and I'm not seeing a difference.
B
12
S
3
Posts: 39
Reputation: 1,001


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 44 guests