Im making a silly 2D game but is struggling a bit with external files that describes how the map should look like.
I currently have map001.txt that looks like this
00000000000000000000
01111111111111111110
01111111111111111110
01111111111111111110
01111111111111111110
01111111111111111110
01111111111111111110
00000000000000000000
00000000000000000000
00000000000000000000
Using TextReader does not make it happen, it cant seem to find the file 🙁
Windows Phone 7 uses Isolated Storage, which is different approach than other systems e.g. Windows 7.
I assume you are using C# and you have maps predefined. You have two options
there are more option – like using database – but these two are simple and good enough. If I were you I would go with second one. Map looks pretty simple, so the loading time and memory using shouldn’t be a problem.
Best way is to define a helper (if you are interested why I made it static readonly here’s an explanation)
Now if you want to extract the map as lines here a snippet
to get the width and height use