Making a Z order system: A better collision system

4

Features on these Courses

Stats

2,218 visits, 2,988 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 2 Jun, 2019.

In this final tutorial, I'll talk about a way to make use of the new features of Construct 3 to make a better collision system.

Collision filtering

In Construct 3, solid objects can define a list of tags that will be used to filter the collisions.

So we first need to set every solid to the right layer tags

Next, we need to update the collision filter tags for every object on every frame when sorting them.

And finally, in the stairs system, if the moving object happens to be a solid as well, update its tags.

Note

Note that since during the last tutorial we replaced the layers with a Z value, a Z order instance could be between two layers, so if that's the case, just add two tags for each layer separated by a space.

floor(ZOrder.Z) = ZOrder.Z? "Layer"&ZOrder.Z : "Layer"&floor(ZOrder.Z) & " Layer"&ceil(ZOrder.Z)

Welp, that's it. This is the end of this course. Hope you liked it, and don't forget to give me feedback on how I did. Any feedback will help shape the next tutorials I'll be making.

Have a nice day, bye.

  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!
    • [-] [+]
    • 1
    • 1 points
    • (1 child)
    [deleted]
    • You taught me lots about multiplayer and though I do respect your work on zorder for strawberry punch I don't think we used a similar technique.

      Still I don't take credit for the method myself, I doubt that either of us invented z ordering systems.

      And thanks :)