Alright, with my current code my map file can look like this.
!Comment line blah blah blah
111111117891111111111111
111111114561111111111111
111111111231111111111111
I am wanting to, parse I believe it would be called. (Sorry I am still fairly new)
This is what I would like to turn my map file into (This way I am not limited to 9 different tiles)
!Comment line
1,1,1,1,1,1,1,1,1,22,1,1,1,1,1
!and so on
Current Code
[spoiler]
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
// no more lines to read
if (line == null) {
break;
}
if (!line.startsWith("!")) {
lines.add(line);
width = Math.max(width, line.length());
}
}
height = lines.size();
for (int j = 0; j < height; j++) {
String line = (String) lines.get(j);
for (int i = 0; i < width; i++) {
if (i < line.length()) {
char ch = line.charAt(i);
Tile t = new Tile(i, j, Character.getNumericValue(ch));
tilearray.add(t);
}
}
}
[/spoiler]
Sorry to have to ask, but where do I go from here, how would I be able to get the numbers between each comma (,) ?