someone please help. I am trying to display an image of a brick layer by layer but when i run my code it just displays one brick at the position where the loop ends. Thanks for helping me out.
public class Game extends JApplet{
Image [][] bricks = new Image[3][15];
public void init()
{
Image brick = getImage(getDocumentBase(),"brick.png");
for(int i =0; i < bricks.length; i++)
for(int j = 0; j < bricks[0].length; j++)
bricks[i][j] = brick;
}
public void paint (Graphics g)
{
for (int i = 0; i < bricks.length; i++)
for ( int j =0; j < bricks[0].length; j++)
g.drawImage(bricks[i][j],i+85,j+30, this);
}
}