• Advertisement

Archived

This topic is now archived and is closed to further replies.

2d Z Order implementation?? :((

This topic is 6384 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I implement Z Order in my 2D game? I got a ground to draw first, then character, then trees and houses. But if my character below house it draws house over my character. How to get rid of it?

Share this post


Link to post
Share on other sites
Advertisement
I think it would be easiest to make your own data structures which hold sprite data in ram, then do custom bltting routines... if the z is greater on the pixel source, it is blitted to the dest, if the dest is greater, nothing happens.
Then do a final blt to the front.

edit: I think some snes emulators take this approach.

Edited by - iwasbiggs on September 2, 2000 1:53:58 AM

Share this post


Link to post
Share on other sites
Every frame do this:

- clear the screen
- Draw the ground
- Draw everything in the order of top of the screen to bottom of the screen

Of course, there are better and faster ways, but this might get you started.

Share this post


Link to post
Share on other sites

  • Advertisement