I'm currently developing a tetris clone and I have a problem saving the blocks.
I want to save the blocks in a two-dimensional array that represent the game grid (10x20). I simply want to change the values of the array (to the specefic shape type eg, 1,2,3,4... 0 if there is no block) if there is a block in that specific coordinate.
this is for the z block. the 2 is the center of the brick (the starting point / startx,starty). I'm think that I should save the block in an array as shown in the comment above. 2 is for the center brick which is the coordinates i need to build it from. 1 is another block and 0 is no blocks. But I don't know how to save this array in my current game grid array.
You would save a lot of code, time and effort if you separate the blocks into their on class.
I have developed a VB.NET version, if you are interested.
With my version, I have separated the grid ( which is the black box where all shapes will appear in ), the shapes, the movements etc. of the shapes, and the graphic oriented stuff into separate classes. Much more manageable.