I am trying to make a grid of slots for an inventory sort of thing , I have it looking how I want it, but I was wondering if there was anyway to simplify or shorten my math. Every square on the grid is 30 X 30.
for (i = 1; i <= Math.floor((QuartzBackground.width - 10) / 30) * 3; i++)
{
// X Position
trace(((QuartzBackground.x + ((i - 1) * 32.5)) - (Math.ceil(i / 9 - 1) * (QuartzBackground.width - 10))) - ((Math.ceil(i / 9) - 1) * 2.5));
// Y Position
trace(QuartzBackground.y + 57.5 + (Math.ceil(i / 9) * 32.5));
}