Objects on an Isometric map

Started by
0 comments, last by JSCFaith 22 years, 8 months ago
Hi, Well, should the tiles on an isometric map, know what objects are on it, or should they not, or should the object know what tile it is on? Or should both know? The reason I ask is, that I was wondering how you should calculate what order to draw objects in. Not the tiles, but objects, such as maybe a Car, like in Simcity 3000, or a building. How do you figure out the order in which to draw the objects in as little time as possilble. P.S. I realize that you should draw them from left to right, top to bottom. Thanks
Advertisement
Yes, it is common for the objects to know what tile they are in, but I don''t use that info for drawing.

I loop through each tile in the map structure (L-to-R, F-to-B) and draw each tile and its contents. Or you could draw each layer all at once - draw all the backgrounds, then all the objects (etc) though it costs an extra loop.

In either case, I loop through the map structure to get to the objects, so the object doesn''t need to know where it''s at (TileX, TileY) to draw itself.

Where storing that info in the object does come in handy is actions that start from the object. Ai routines, line-of-sight routines, that sort of thing.

Of course, this is just what I do, your mileage may vary.

This topic is closed to new replies.

Advertisement