so i have a cube object that i made as a base for a wall but the wall is a bunch of different shapes, so i was wondering if i could stick them end to end without doing it manually as there's two of each shape in the mapped area.
public void wall(int x, int y)
{
World.addObject(new cube(), x, y);
y= y-cube.getHeight();
World.addObject(new tirangle(), x, y);
y= y-triangle.getHeight();
World.addObject(new circle(), x, y);
}public void wall(int x, int y)
{
Cube cube = new Cube();
getWorld().addObject(cube, x, y);
y-=cube.getImage().getHeight();
Triangle triangle = new Triangle();
getWorld().addObject(triangle, x, y);
y-=triangle.getImage().getHeight();
Circle circle = new Circle();
getWorld().addObject(circle, x, y);
}private int [] xLocations = {491, 507, 523, 539, 555, 571,...
private int [] yLocations = {402, 402, 402, 402, 402, 402,... private void makeWalls()
{int q = 0;
while(q <75)
{
addObject(new Wall(),xLocations[q],yLocations[q]);
q = q + 1;
}private int[][] map ={
{1,1,1,1,1,1,1,1,1},
{1,0,0,0,1,0,0,0,1},
{1,0,1,0,0,0,1,0,1},
{1,0,1,1,1,1,1,0,1},
{1,0,1,0,0,0,1,0,1},
{1,0,1,0,1,0,1,0,1},
{1,0,0,0,1,0,0,0,1},
{1,1,1,1,1,1,1,1,1}};private int[][] map = { { 9, 1, 1, 1, 1, 1, 1, 1, 3 },
{ 8, 0, 0, 0,10, 0, 0, 0, 2 },
{ 8, 0,15, 0,14, 0,15, 0, 2 },
{ 8, 0, 0, 0, 0, 0, 0, 0, 2 },
{ 8, 0,15, 0,11, 0,15, 0, 2 },
{ 8, 0, 0, 0,10, 0, 0, 0, 2 },
{12, 4, 4, 4, 4, 4, 4, 4, 6 } };
// with the following in a method
for (int y=0; y<map.length; y++)
for (int x=0; x<map[].length; x++)
{
Actor actor = null;
switch (map[y][x])
{
case 0: break;
case 1: actor = new Wall("top"); break;
case 2: actor = new Wall("right"); break;
case 3: actor = new Wall("top-right"); break;
// etc.
}
if (actor != null) addObject(actor, 8+x*16, 8+y*16);
}