Platformer on solid that's changing angles

0 favourites
  • 4 posts
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • Hi guys, I have a problem with one of my projects.

    Basically, I have a platformer object on a solid object. Whenever the platformer object moves left, the object starts dipping left, kind've like a seesaw. The platformer's gravity angle is set to the solid + 90. (This ensures he stays on the solid and doesn't fall off, also allows for smoother movements of the platformer object).

    The problem: Because the solid is tilting, sometimes the platformer object "isn't on floor". I have the solid object only tilt if the platformer "is on floor". This makes the seesaw tilting kind've rough.

    When I removed the "is on floor" for the event that tilts the seesaw, it was smooth however it still tilted if the platformer object jumps.

    Is there a way to make the seesaw tilt smooth and make it only tilt if the platformer object is on the seesaw? I assume it'd involve using 'is overlapping at offset'. Anybody know how I can fix this issue?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can do this with "overlapping at offset", but this will require some math.

    There is an easier way:

    Define an imagepoint on the platformer sprite, which is a few pixels below its bottom edge. (outside the image)

    Then you can use this event to check if platformer is on the tilting Floor or within several pixels from it:

    System-> Floor is overlapping a point (platfromer.ImagePointX(1), platfromer.ImagePointY(1))

  • Thanks dude! I tried both ways. The point worked but then if I got to an edge it would stop. After using that point idea, I realized how much I should offset the player's y by and check for an overlap.

  • You can define two image points on both sides of the player, just below its bottom edge.

    But yeah, overlapping at offset is a better way of doing this, as long as you get the math right.

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