Beat 'em up z order question

  • For those interested, I solved it in this way:

    If Sprite1 Is Overlapping Sprite2:

    _____If Sprite1.Y > Sprite2.Y:

    ___________Sprite 1 -> (Z Order) Move to Object -> "IN FRONT", Sprite 2

    _____Else

    ___________same but "BEHIND"

    So the computer will just make that calculations when overlapping and not every tick. I don't know if it saves speed but I guess.

    It's usefull if the sprites has the origin point in the same place (example: bottom). If you have objects with differents origin points (ex: Sprite 1 -> bottom, Sprite 2 --> center), you can create blank sprites with equal origin points and "pin" them to the sprites you have. Or simply use another points (Image Points) in the same sprite for this matter.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)