How do I z-order a jumping character in a beat'em up?

0 favourites
  • 7 posts
From the Asset Store
Pixel art beat'em up with local multiplayer, 4 characters, 2 enemy types and a boss!
  • Hello! I'm making a beat'em up game using 8 direction. I had to find a way to organize the objects's z orders based on their Y position, and the simplest way to do that was with the plugin Rex Z sorter, like this:

    And it worked! The character's and enemies' position is just like it should be!

    Except... when the character jumps

    The character's z order change, he should be in front of the enemy closer to him but is now behind him, and it makes sense. When he jumps he changes his Y position.

    I tried applying a condition to that every tick I showed above that only changes z orders if the character is not jumping. But that would make enemies go over each other without changing z orders every time the character jumped.

    Will I have to find another way to do this? Or does anyone know how to get around the z sorter plugin and make the character keep his z order when he jumps?

    Thanks!

  • maybe using a helper container sprite staying on 'the ground position' for z-order?

  • maybe using a helper container sprite staying on 'the ground position' for z-order?

    I tried that already :/. I made an object that follows the player around, stuck to his foot, when he is not jumping. When he is jumping, I tried setting the player's z order to this object's z order

    And this happened, every time I jumped an enemy above me vanished!

    Debugging the project I saw that the enemy wasn't set to Invisible. It misteriously vanished.

    This probably happens because I'm telling to always set the object's z index based on their position, and asking once for the player to not do that bugs the plugin.

    Do you perhaps have a suggestion on how to make this system without using the plugin, or another suggestion on how to try and change only the player's z order when jumping? Thanks!

  • Quick thought, move your current event "Sort all objects" to under a condition of Player != Jumping

    Then, under an else condition, run the event "Sort all objects" but for everything except that player.

    I haven't used this particular plugin so I don't know if you could do that. But maybe a family would work? Just sort the objects in the family?

  • Quick thought, move your current event "Sort all objects" to under a condition of Player != Jumping

    Then, under an else condition, run the event "Sort all objects" but for everything except that player.

    I haven't used this particular plugin so I don't know if you could do that. But maybe a family would work? Just sort the objects in the family?

    That would definitely work, but unfortunately I can't make exceptions (not that I know). Maybe there's an advanced way of making exceptions with this plugin, but then it would take its simplicity away. I'll try to do that using families and not the plugin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • marcosfl I have the same assets there Brilliant!

  • marcosfl I have the same assets there Brilliant!

    Great assets, aren't they? Haha!

    Thank you all for your replies, I managed to do it using families

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