@Override
public void paint(Graphics g) {
for (int i = 0; i < map.length; i++) {
for (int j = 0; j < map[i].length; j++) {
if (map[i][j] >= 0) {
SpriteCell cell = sheet.getCell(map[i][j]);
int x = j * tw;
int y = i * th;
bg.paint(g, x, y, null);
if (cell != null) {
cell.paint(g, x, y, null);
}
}
}
}
}