Original Post
Well I did tetris, and now im ready to move on...id like to do one of my favorite puzzle games: Tetris attack (pokemon puzzle league to some of u). The thing is, I think I have some basic idea of how the code will look, but I want to post here to be reassured im on the right track.
In tetris attack you have a bunch of blocks in rows and columns and slowly more are added row by row as the rest are pushed up...get to the ceiling and you loose.
You get rid of blocks by swapping horizontially two blocks to complete sets of 3 or more blocks (horizontaly or vertically). Once this is done they dissapare, and the blocks above fall until they hit bottom or more blocks.
This is where it gets interesting for me, while the blocks fall they can complete chains, by falling into place with 3 or more blocks (again horizontally and vertically) this can go on indefinitely provided there is 2 blocks with space to recieve the 3rd or more.
My question is, how in a general pseudo code since would some of this look like. YOu have an array, of say playfield[15][30] which is a playfield of 15 rows by 30 columns (this isn exact) and in this field u have each element filled out with a block type..t and the players are basically always just swaping blocks horizontally so its a simple array swap..still easy.
But how do you check for horiz or vert rows to be completed? after ever swap check the whole array and keep a count variable on current type. say the top left row and column has a blue block...so you go horizontally from there...if the next column on the same row is blue..keep traversing...if not try to travers the next row, if not there, move to the next column and start over?
Then every frame you have to make sure blocks are falling, call say a moveblocks it just checks to see what blocks in the array are above a empty block element (represented by say -1?) and shuve the blocks down a column until they reach a element in the array that isnt -1 (blank)
Now comes the hard part, somewhere in the falling mechinism i would guess, is when chains can be completed...so is this where you check for chains? and I havent a clue at all even vaguley how this would look.
So any ideas to get me started here? Not asking for a handout really, just an idea on getting chains, for I cannot think of a good way to do it (and also to be reassured the other ideas I have on attacking the other problems are correct or close to correct)
Thanks,
Shane