Created
September 27, 2012 22:14
GetLevelData Method part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void LoadMapData(string name) | |
{ | |
string path = "MapLayouts/" + name + ".txt"; | |
// Width and height of our tile array | |
int width = 0; | |
int height = File.ReadLines(path).Count(); | |
StreamReader sReader = new StreamReader(path); | |
string line = sReader.ReadLine(); | |
string[] tileNo = line.Split(','); | |
width = tileNo.Count(); | |
// Creating a new instance of the tile map | |
tileMap = new int[height, width]; | |
sReader.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment