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.