HOW CAN I JUMP IN AN 8-directions or RPG GAMES?

From the Asset Store
Character Sprite Pack: Walk 4 Directions made in illustrator
  • trying to make a game like nes startropics, but I don't know how to make the player jump over an obstacle or from one side to the other.I have tried everything and it is impossible for me to do it.

  • This is a bit difficult to get your head around but is very doable. It's kind of hard to explain so forgive me if this is difficult to follow - I'll try to make sense!!

    First of all, you'll need to have the player collision set up in the right way. For top-down games, you should ideally have the player's collision object set to be a small shape at the character's feet (like you are controlling their 'shadow'). This will allow you to easily keep track of where the character's feet should be in relation to the ground.

    "Jumping" in a top-down game is kind of weird to get your head around, but really, the player collision object doesn't jump - only their visual representation. In the first Startropics screenshot you posted, you can imagine that what you are really controlling is the guy's shadow, and the actual character sprite just moves up and down to look like a 'jump'.

    So, to implement jumping all you need to do is:

    1) Give the character an animation that looks like 'jumping'

    2) Add obstacles that the player's collision object cannot pass unless the character is in their 'jumping' state

    Is this making sense? 🤔

  • 🤔mm...If I think it makes sense, it is as if it were an illusion. I just have to handle the animation of the sprites. I will try to do it. Thank you very much I would never have thought of it that way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As mikehive says you can use separate hitbox and animation objects. You can handle the jump with a tween of the Y position and disable solid collisions with the hitbox object. Have a look at this basic example to get a feel for what you need to implement.

    1drv.ms/u/s!AkmrWgxeuxlKhIhKTESmz9TOFQJM9A

  • wow! Excellent, thank you very much, this will help me a lot.

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