Hey, I just tryed to draw a world random.
So I made a number between 1-700.
This is how I draw the world.
for(int x=0;x<mapArray.length;x++){
for(int y=0;y<mapArray.length;y++){
if(mapArray[x][y] <=500 )
g.drawImage(grass,x*16,y*16);
else if(mapArray[x][y]> 500 && mapArray[x][y]<= 580)
g.drawImage(tree,x*16,y*16);
else if(mapArray[x][y]> 580 && mapArray[x][y]<= 699)
g.drawImage(earth,x*16,y*16);
else if(mapArray[x][y] == 700){
g.drawImage(wall,x*16,y*16);
}
}
}
The world will be drawn correct.
http://s14.directupload.net/images/121226/temp/z95hcnfj.png
I just wonder why the tree below right has the wall as a background?!?!
But more importent, I wanted to draw beside a wall another wall.
But I just dont get it to work, so can someone tell me how to do it?