Jump to content
Posted 14 November 2012 - 03:10 PM
Posted 14 November 2012 - 03:39 PM
I am making an isometric game in 2D and am having some difficulty in coming up with a solution to my current problem.
If I have lots of little characters (just an example) running around the screen, I want to know what order to render those sprites in. I already know that I can do this simply by knowing each of the characters Y coordinate (If the Y coordinate is lower than one sprite, then it should be rendered in front).
I have already written a sample program that gives the illusion of a ball orbiting around a pole. Trouble is, if I have lots more than just two sprites - for example 20 sprites... it becomes a little more complicated.
I am struggling because obviously, a web of IF statements will not suffice. I would like to know if there is a common method that people may use in this situation? And, lets say for example I was able to get all the objects Y pos and order some kind of virtual Z buffer array that will help me order the rendering, how would I go about this for those objects already contained in a vector (A vector containing 10 generic automated characters for example).
Any thoughts on this? (That is, if I have explained myself correctly). I am using Direct3D 9.0 and C++ although I am sure languages and library's do not really come in to this much.
Posted 14 November 2012 - 03:55 PM
Posted 14 November 2012 - 03:56 PM
Posted 14 November 2012 - 04:01 PM
Posted 14 November 2012 - 05:25 PM
Edited by KnolanCross, 14 November 2012 - 05:27 PM.