Hi T-Bear,
If you are storing an X,Y pair for each item in the Tiles and Objects array, then you can improve things quite a bit by moving to a two dimensional array.
Code:
Tiles : array[0..200,0..200] of TTile;
Objects : array[0..200,0..200] of TObject;
Which obviously has the limitation of hard coded sizes. If you're using a dynamic array where you work out an index like index:=x+(y*width); then providing you only iterate through the cells that appear in the visible area, you're not going to gain too much I wouldn't have thought by changing it.
When I wrote a tile based game for one of our competitions, I used pointer based datastorage which is in fact much like the dynamic array with index calculations.
Can you post some of the code where you are actually using the map?
Bookmarks