I am making a 2D platformer game in Python, and I need to store the maps in a file, then load them as a list. The file will contain something like this:
[[1,1,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2],
[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,2,2,1,0,0,0,0,1,1,0,0,2,2,0,0,0,0,0,1,2,1],
[0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0],
[2,0,0,0,0,0,1,1,0,2,2,2,0,1,1,0,0,0,0,1,0,0,0],
[0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0]],
and it needs to make a list like this:
platforms = [[1,1,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2],
[0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,2,2,1,0,0,0,0,1,1,0,0,2,2,0,0,0,0,0,1,2,1],
[0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0],
[2,0,0,0,0,0,1,1,0,2,2,2,0,1,1,0,0,0,0,1,0,0,0],
[0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0]]
Is there any way I can do this?