javascript - Storing a big 2d map in memory efficiently -
i'm creating 2d tiled game pokemon-like i'm creating map editor create maps.
game on web, map editor must web.
don't know how store map in memory:
thought use 2 dimensional array, map can bery big, leading massive memory usage/out of memory problem.
how can store entire map in memory efficiently, without using browser memory?
the standard seems not having entire map loaded in memory, current viewport or bounds
referred in mapping world.
you check bounds on map pan, scroll or zoom , fetch corresponding tiles.