
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.53 KB | hits: 23 | expires: Never
public Level(String ref){
tiles = new SpriteSheet("res/rtiles.png", 2, 2);
try{
Scanner s = new Scanner(new File(ref));
int width = s.nextInt();
int height = s.nextInt();
data = new int[width][height];
terrain = new int[width][height];
for(int y = 0; y < height; y++){
for(int x = 0; x < width; x++){
data[x][y] = s.nextInt();
}
}
for(int y = 0; y < height; y++){
for(int x = 0; x < width; x++){
terrain[x][y] = s.nextInt();
}
}
}catch(Exception e){
}
}