Talk:Data structures for the map
Jump to navigation
Jump to search
"So, there are lists of Objects, Items and Monsters on the given level. Every element of these lists must also store the position. Every time you want to know what items lie on given square, you have to iterate trough the list of all items and take the ones with proper position set. It might seem slow, but you won't have to do it often."
Why shouldn't we use pointers (or some sort of reference if in a non C language) to reference objects in our 2d array. Some of the coding is done a certain way to make it all fast, and then we have to scan through arrays to find all nearby objects and mobs.