Hello everyone :)
I have been trying to loop an image using the for loop within graphics 2D which consists of 17 images on the x axis and 17 images (across) on the y axis (down), creating a 'L' shape. When I compile and run the program however it prints 17 images on the y axis and none on the x. I have no idea what fault I have made as whatever I do it seems to ignore the x axis (or at least the way i interpret it to be printed.) How do I make it print along the x-axis? What exactly am I doing wrong? Here is my code:
Code :private void drawMaze(Graphics2D g){ Graphics2D g2 = (Graphics2D)g; int width = 17; //number of images drawn along the x-axis (none) int height = 17; //number of images drawn along the y axis int xOffset = 21; //width of image int yOffset = 21; //height of image int currentX = 10; //initial x coordinate of image int currentY = 10; //initial y coordinate of image for(int i = 0; i < width; i++) { for(int j = 0; j < height; j++) { g2.drawImage(cobblestone.getImage(), currentX, currentY,this); currentY += yOffset; } currentX += xOffset; currentY = 0;
Any help would greatly be appreciated, thanks!

