mike

mike

  • NA
  • 1
  • 0

Storing multidimensional array to a file

Jan 4 2010 9:12 PM
I'm trying to make a platformer game with a 2d tile map, and i'd like to be able to store the levels as files, so that i can add new levels without hardcoding them.  Each level is going to be stored as a 3 dimensional array like [80][20][3]. The first two dimensions store the level data, and there are 3 layers of data for the background, the foreground, and the objects.


My problem is, I'm not sure what the best way to go about storing/loading a 3 dimensional array from a file would be. Not necessarily actual code, because i'm doing this as a learning exersize, but just some ideas on how to store the array in a file and what would be easiest.

Thanks in advance to anyone who looks at this

Answers (1)