> Working on an isometric puzzle game. Currently just making sure the most basic elements are working.
>
> 3D pathfinding, zSorting of objects, lighting, triggers etc.
>
>
I like a lot!
NotionGames
Thanks!
This is amazing! How do you zsort? Is it like everything higher is in front of everything lower, and then sort by z? Basically sorting by y then z?
UberdroidGames
Thank you!
Each sprite has a X,Y and Z position, a function then calculates a 'zOrder'-variable for each sprite using these values. This value is then used with the system 'sort Z order'-action. There are also furnilayers, this is a way to sort items that might have the same XYZ coordinates (e.g. the fences in the gif).
Here's the math for it:
(((ceil(Self.posX*100)+ceil(Self.posY*100))/100)+ceil(Self.posZ*1001)/1000)*10000+(Self.furniLayer*10)
Here's a good runthrough on isometric projection: clintbellanger.net/articles/isometric_math