Hello.


I would like to know what the “best”, most efficient way is to handle objects on a tile map. So far I have mostly done it with one huge array which was easy to implement but feels inefficient. This way I have to loop through each item on each frame to see whether it is on screen and should be rendered. Is there a nicer way of handling these kinds of objects?


My previous code:
Tmap = class
public
Tiles: array of Ttile;
Objects: array of Tobject;
end;



Mostly I'm just curious what the "proper" way is of doing this. Maybe I am doing it completely wrong from the start.