Is there a size limit when using UICollectionView as tiled map for iOS game?
Posted
by
Alexander Winn
on Game Development
See other posts from Game Development
or by Alexander Winn
Published on 2014-08-19T21:38:10Z
Indexed on
2014/08/20
4:31 UTC
Read the original article
Hit count: 255
I'm working on a turn-based strategy game for iOS, (picture Civilization 2 as an example), and I'm considering using a UICollectionView
as my game map. Each cell would be a tile, and I could use the "didSelectCell" method to handle player interaction with each tile.
Here's my question: I know that UICollectionViewCell
s are dequeued and reused by the OS, so does that mean that the map could support an effectively infinitely-large map, so long as only a few cells are onscreen at a time? However many cells were onscreen would be held in memory, and obviously the data source would take up some memory, but would my offscreen map be limited to a certain size or could it be enormous so long as the number of cells visible at any one time wasn't too much for the device to handle? Basically, is there any memory weight to offscreen cells, or do only visible cells have any impact?
© Game Development or respective owner