Jumping onto Z Elevation Platforms

0 favourites
  • 6 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • .cp3 link https://drive.google.com/open?id=1RBqWtX3ymDUtZAPNY82qM4IW7BTPuDK5

    WHAT YOU'LL SEE: Looking top-down, you'll see grey squares ("Ceiling tiles") falling down at random rates. Z Elevation is basically being reduced each. The purple shape is the Player Character (use WASD or arrow keys to move and B to jump). The red/pink circles are Energy Bases and have the Solid behavior.

    THE GOAL: As the Tiles descend, they'll come within range of the Player's ability to jump above them. The idea is to be able to jump on top of them and make it appear as if the Player is actually standing on top of a Tile. However, if the Tile is clearly too low, the Player's max jump height is cut short. ...Like Mario Bros but with a different camera angle.

    CURRENT ISSUE: The problem I discovered is that if the Player is overlapping at least 2 Tiles, I have no clear way to discern which one is the lower one. Off the top of my head (meaning, not yet tested), I could stuff all the Z Elevation values into an array and sort then pick by ascending/descending values, but I'm wondering if there's an easier way.

    Further, I discovered (tested) that even when overlapping just one Tile, the Player still can jump up and through it. So my effects to use Clamp( ) doesn't seem to have any effect.

    I was hoping someone could help me identify if my current set up is off or if I need an entirely new approach. Thanks!

  • *bump*

  • *bump bump*

  • *bump from page 3*

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The reason the clamp isn't working is because you're using a local number to represent Max Jump Height

    Local numbers are reset to their default value each time the event they're nested in runs

    In this case your local numbers are "out in the open" under a group, so each tick the local number is reset to 20

    Change it to a static local number to solve this

  • Thank you. I cannot believe I forgot about that detail. I'll test it when I get home.

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