4 ms·
That's impressive, but it crashes Safari on my 1st gen iPad, probably from memory use. How is the map stored? An object per tile?
by extension 15y ago
That's impressive, but it crashes Safari on my 1st gen iPad, probably from memory use. How is the map stored? An object per tile?
- ostracod 15y agoYes, unfortunately each tile is an object. I am going to optimize the game so it can run on earlier generation devices. Lower memory impact is one of my priorities.
- extension 15y agoYou could store the map in strings representing, say, 16x16 tiles each. You'll have to replace the entire string when a tile changes, but that shouldn't be a big deal if they are only 256 chars. And you might be able to pack multiple tiles in a single char. Or just use an array of ints, if you can be sure that they are stored as primitives.