Ah! Thankyou! That works much better. I'm not quite sure what these lines do, though:
Code: AGS
So, while x < 0, add the width of the image to the offset, and make x the remainder of the division the offset by the width. If I'm reading this correctly, it's making the offset a number between 0 and the width/height of the image?
while (x < 0) x += w; x = x % w;
while (y < 0) y += h; y = y % h;
So, while x < 0, add the width of the image to the offset, and make x the remainder of the division the offset by the width. If I'm reading this correctly, it's making the offset a number between 0 and the width/height of the image?