OpenGL 2D Depth Perception
Posted
by
Stephen James
on Game Development
See other posts from Game Development
or by Stephen James
Published on 2012-04-04T10:36:09Z
Indexed on
2012/04/04
17:43 UTC
Read the original article
Hit count: 570
I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in front of the tree/enemy (lower than the objects y-coordinate) then show the player in front), if the player goes behind the tree/enemy (higher than the objects specific y-coordinate), then show the player behind the object.
I have tried writing a block of code to deal with this, and it works quite well for the trees, but not for the enemies yet. Is there a simpler way of doing this in LWJGL that I'm missing?
© Game Development or respective owner