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-04T11:05:18Z Indexed on 2012/04/04 11:42 UTC
Read the original article Hit count: 401

Filed under:
|
|
|
|

This is the first time i have ever commented on a forum about programming, so sorry if I'm not specific enough.

Here's my problem: 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?

Thanks :)

© Game Development or respective owner

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: 400

Filed under:
|
|
|

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

Related posts about opengl

Related posts about 2d