Expand|Select|Wrap|Line Numbers
- 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 x to move next square along
- }
this is supposed to create a line along the X axis of squares that is in thge class Tile but it only creates 1 the for loop worksand in theory the x should go 10 60 110 an have at least 3 squares but i dont know why it doesnt work any help is greatly appreciated.