Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
0
Members

How does drawing order work in SuperPowers?

A topic by fufroom created Nov 30, 2016 Views: 407 Replies: 3
Viewing posts 1 to 3
(1 edit)

I want the player to be able to "walk around" the trees, and also any tree drawn with a lower y position to be drawn in front of the trees with higher y positions.
It's easiest to see in a gif:

If you have it set so UP / DOWN = the Y-axis, and the Z-axis controls 'depth', then you could do something like so:

this.actor.setZ( -this.actor.getY() ):

for each actor in your scene. That way, actors that are lower on the screen [ i.e. closer to the camera ] appear in front of actors that are further up on the screen [ i.e. farther away from the camera ].


Let me know if this helps or if I should explain anything more.

(+1)

Hey! There we go, thanks you are awesome!

Cool, nice job!

Good luck on the rest of the game :)