1. ## Arranging Breakout Blocks

I've been trying to figure out how to arrange my blocks, for a breakout type game. I was thinking of declaring variables of type int (columns and rows) and then use a for loop to draw the amount of blocks that I need. Would this work? Or can I use an array to better display these? Such as char red_block[10][10]. I know the best thing would be to create a tool that would aid me in displaying these blocks, but I'm not planning on doing that much work for something I will never use again. So any help would be nice! Thanks!

2. Wont parsing a simple text file that has a map of a specific level work well enough?
Something like:
1,1,2,2,1,1
1,1,1,1,1,1
0,0,0,0,0,0
0,0,0,0,0,0
etc.

3. I could just do this in a 2D-Array, no? I am going to have different colored blocks (red, green, blue, etc.) So I would have to define which number equals what color?

4. Yes, a 2D array should do the trick nicely.
After you parse the text file make sure to place the data into an array.
Then have your engine use that array for building and drawing your in-game level.

5. Alright! So, for the defining the color constants which would be the best to use, from the following:
Code:
`const int red=0`
or
Code:
`enum COLOR={GREEN,RED,BLUE}`
I think the enumeration is the best way to go, but what do I know

6. 0 could be an empty space and you would be left with 9 colors. Alpha characters could be used for special blocks:

Code:
```2,w,0,0,2   w = wall block
2,2,w,0,3   x = bomb block
4,x,0,3,3   2 = green, 3 = blue, 4 = grey, 0 = empty space```
If you had different size blocks, you could build a matrix like so:

Code:
```333,220,22,3,www     1, 2 and 3 size blocks
w,444,2,000,22,22
x,22,0,3,0,44,332,2     note that all lines have 12 positions```
if the size of blocks extended vertically also. The matrix could look like,

Code:
```333,222,22,3,www     empty spaces extend the block on the top.
,   ,33,33,22     note that they have to have the same size
w,444,2,333,22,22    as the block on top of them.
x,22,3,3,3,44,332,2```
Then juts build a nice parser for this. An implementation as easy as this also makes building a level editor a breeze.

7. Are these blocks sprites or are you rendering them as quads? If you're rendering them you're going to want to make a struct of block information because there is going to be alot of information.
Code:
```struct blocks {
GLfloat corners[4][2];  // X and Y values for the 4 corners
GLfloat color[3];  // Red, Green, Blue;
};```
All of this information should be contained in your text file.

1.0, 1.0
0.0, 1.0
0.0, 0.0
0.0, 1.0
1.0, 0.0, 0.0

etc...

8. I am using SDL and C++ to make this. So the blocks are sprites, with a .bmp extension.

For blank space I could assign NULL to a value?

9. In case you read a '0' character for example from the array you just parsed, the engine should not create a block in its place.