N
NukeyFox
Guest
I'm making an isometric game, so some sprites overlap.
The red blocks are placeholders for the playable characters.
I can click on the red blocks and it will store the id in a global variable global.player_selected.
The depths of the red blocks are set by depth = -y
However, when clicking overlapping sprites, e.g. the middle one in the picture, it selects the one behind it.
Is there a way to select the red block that is most in-front (with greatest depth)?
Most ideas I had didn't work out, so I'm currently drawing a blank right now.
Thanks
The red blocks are placeholders for the playable characters.
I can click on the red blocks and it will store the id in a global variable global.player_selected.
The depths of the red blocks are set by depth = -y
However, when clicking overlapping sprites, e.g. the middle one in the picture, it selects the one behind it.
Is there a way to select the red block that is most in-front (with greatest depth)?
Most ideas I had didn't work out, so I'm currently drawing a blank right now.
Thanks