How do I “jump” in a Top-Down game.

0 favourites
  • 3 posts
From the Asset Store
Set of tiles to create a map for top-down games with island theme
  • Hello,

    What I try to achieve is for a solid object, to be able to “jump over” (passing through) a solid obstacle when a button is pressed. This without using physics and without passing through other solids.

    I have attached a simple .capx as an example.

    As the game world is filled with solids (jumpable obstacles, not jumpable obstacles and enemies that keep following the player), the player should be able to only “jump” over the obstacles but not being able to jump over (passing through, other solid.

    In the .capx, attached, I try to explain the scenario that is composed by:

    -a player

    -a enemy that follows the player

    • an obstacle (like a fence)

    -And a box

    The player and the enemy cannot pass through any other solids. But by pressing a button, the player should be able to jump over the obstacles, but not over the box.

    At the same time, the enemy will still not b able to jump over the obstacles.

    Any contribution would much appreciate!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not yet had time to check the capx sorry, but one solution would probably be to switch to an animation "jump" and during that animation disable the behaviors on the player (solid and movement), and then force the player to move forward until the animation ends. Do a check before triggering the jump to make sure the player is facing towards an obstacle and is allowed to jump over it (eg: overlapping a sprite made invisible called AllowJump).

  • I made an example...

    [attachment=0:1nwx9fob][/attachment:1nwx9fob]

    The problem is, I'm tweaking the fences solid behavior, so, when the player jumps, the enemies can cross the fences too. I'll try to work around this issue, but, for now, you can check this version!

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