So I created this grid engine when you press L the whole map gets loaded 200 by 200 32 pixel tiles what is way to much so the game crashes.
Even when I set the limit to 50*50 it loads but is super laggy but when I do the amount of tiles you can see in the frame it works fine.
Just 1 problem when you scroll down or to the right that piece of the frame isn't loaded.
So I tried making a chunk loader when you scroll to the right it loads the string from the array and place the tiles.
But it didn't work how can I do this? Take a look at the source file.
Also includes a save file this save file is 200 by 200 pieces of grass.