Computer Science Canada
Tetris (again)- giving a value to a 2d array
|Author:||Neja [ Mon May 24, 2004 8:19 pm ]|
|Post subject:||Tetris (again)- giving a value to a 2d array|
I have my grid for tetris which looks something like this:
I've also given all my shapes (the T,Ls,square,Zs and line) values (i.e. block (1,1):=1)
I've been able to have them drawn on my grid using coordinates as follows:
- but I find this method inconveniant because I have a more difficult time manipulating the shapes as they fall or get rotated. I've tried using my block array to manipulate the shapes, but it isn't working and I can't figure out why:
So, I suppose the general question is how do I manipulate my shapes?
|Author:||Andy [ Tue May 25, 2004 9:38 am ]|
i just did hundreds of if statements since i did it the stupid way and used procs to draw the shapes... a really good way to to it is to simply draw them on seperate 2d arrays and just copy them over... better yet use a 3d array of records containing the previous and next block's allocation.