Skip to main content
GameDev.net gamedev.net
🔒 Locked

Overlapping graphics

Started by ErikPeeters Sep 10, 2006 at 9:25 AM 1 replies 1.9k views
Original Post
ErikPeeters
ErikPeeters
Hi, I have a problem creating overlapping graphics. For example, I want to move picture of a train over a bridge. But I want it to look like the train is moving trough the gates of the bridge and not over it. Do I need to separate the bridge pic and depth-sort all the graphis and tiles when I build a structure / put a structure on the tile-map? Can anybody please help me with this issue and perhaps give me an example hoe to accomplidh this? Thanks in advance, - Erik
Demus79
Demus79
Yes, you need to do depth sorting for the graphics. And if you have complex graphics such as gates, you'll need to split them in several parts.

The depth sorting is dependent on the point of view of your tile engine. If it is strictly 2d top-view, then you can consider having different depth-layers such as : terrain, buildings (that you cannot penetrate), units, structures (above the moving units). So this is the simple case.

If you are using a military-perspective for example, the depth sorting becomes much more difficult.

Good luck !
ErikPeeters
ErikPeeters
Thank you for replying!

OK, I will separate the pictures so the train picture can move between them.
I take that it has a little peformance hit but will look nicer on faster computers.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.