Platform physics not behaving as expected

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I am trying to replicate the (very simple) jump physics from the Megaman games, using this thread as a reference: forums.tigsource.com/index.php

    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:

    dl.dropboxusercontent.com/u/25752478/megaman.capx

    I can't figure out what is going on. Please help.

  • 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....

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you haven't played a megaman game, here's a good approximation of how the jump feels: 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)