for (int x = 0; x < map[0].length; x++) {
for (int y = 0; y < map.length; y++) {
if (map[y][x] != 0) {
switch (map[y][x]) {
case 1:
Polygon p2 = new Polygon();
p2.addPoint(x * 32, y * 32);
p2.addPoint((x * 32) + 32, y * 32);
p2.addPoint((x * 32) + 32, (y * 32) + 32);
p2.addPoint(x * 32, (y * 32) + 32);
original.add(p2);
break;
case 2:
Polygon poly = new Polygon();
poly.addPoint(x * 32, y * 32);
poly.addPoint((x * 32) + 32, y * 32);
poly.addPoint(x * 32, (y * 32) + 32);
original.add(poly);
break;
case 3:
Circle ellipse = new Circle((x*32)+16,(y*32)+32,16,16);
original.add(ellipse);
break;
case 4:
Polygon p = new Polygon();
p.addPoint((x * 32) + 32, (y * 32));
p.addPoint((x * 32) + 32, (y * 32)+32);
p.addPoint(x * 32, (y * 32) + 32);
original.add(p);
break;
case 5:
Polygon p3 = new Polygon();
p3.addPoint((x * 32), (y * 32));
p3.addPoint((x * 32) + 32, (y * 32));
p3.addPoint((x * 32) + 32, (y * 32)+32);
original.add(p3);
break;
case 6:
Polygon p4 = new Polygon();
p4.addPoint((x * 32), (y * 32));
p4.addPoint((x * 32) + 32, (y * 32));
p4.addPoint((x * 32), (y * 32)+32);
original.add(p4);
break;
}
}
}