Okay, so I am making a tower defense game and I have a scanner to edit the levels! But it's not working! No errors are showing!
Scanner :
import java.io.*;
import java.util.*;
public class Save {
public void loadSave (File loadpath) {
try{
Scanner loadScanner = new Scanner(loadpath);
while(loadScanner.hasNext()) {
for(int y=0;y<Screen.room.block.length;y++) {
for(int x=0;x<Screen.room.block[0].length;x++) {
Screen.room.block[y][x].groundID = loadScanner.nextInt();
}
}
for(int y=0;y<Screen.room.block.length;y++) {
for(int x=0;x<Screen.room.block[0].length;x++) {
Screen.room.block[y][x].airID = loadScanner.nextInt();
}
}
}
loadScanner.close();
} catch(Exception e) { }
}
}
Values
public class Value {
public static int groundGrass = 0;
public static int groundroad = 2;
public static int airAir = 1;
}
Level
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Please help i've been working on this error for 3 days!