java jba wrote:I am hoping someone could nudge me in the right direction or tweak my thinking a bit to help me solve it on my own.
OK.
First:
StopCoding (←click).
Second: It would appear that you're building your rows of bricks from the top (1 brick) down (to BRICKS_IN_BASE bricks).
The x,y coordinate for the brick will be (as I recall) the
top-left corner of that brick and, since you're building a line, you only have to worry about where the
leftmost brick goes in order to centre them all; all the rest will simply be BRICK_WIDTH pixels further right. So, assuming the first brick of your bottom line starts at x,0, where will the line above that start? And the one above that? And the one above that?... and so on.
If you run into problems, try it first with a fixed number of lines, then try another... and another...and see if you can work out a
pattern.
Alternatively, try centering ONE line of n bricks within a specific width, and then build up from there.
Programming is all about
thinking, not coding; and until you understand the problem, you will never be able to code it.
HIH
Winston