Code:
for (int i=0; i<5; i++) // for loop for creating a background of tiles
{
x=10;
Graphics g = canvas.getGraphics(); // call Tile to draw a tile
Tile[] tile = new Tile[10]; // intialise tile
tile[i] = new Tile(1,x,y); // a new tile for every i
tile[i].Draw(g); // draw it
x=x+50; //change
Leave a comment: