Click to See Complete Forum and Search --> : Creating SHAPES with code.. . . .
eddietheperson
Sep 6th, 2002, 07:39 AM
hey, i am doing something no one has ever attempted before. Recreating a tetris game. I don't know, i just like it. but anyway, i was woundering how to actually how to creat a shape using code and not clicking "add new shape" or whatever. You know in tetris how there are many pieces? I am sure that they didn't have 100 shapes premade and ready to use, they probably had code that generated new pieces using an array, wich is what i need to do...so if you know the syntax, please tell me.
Thanks
:rolleyes:
CornedBee
Sep 6th, 2002, 08:55 AM
Tetris only had - uhm... - 7 shapes I think. Clones like Sitris had more, but it doesn't really matter.
What you do is: take a 4x2 2-dimensional array and put in 1s where there is a block and 0s where not (if you remember - all tetris shapes are made from small quadratic blocks).
Here are the shapes:
[code]
1111 1100 1100 1110
0000 1100 0110 0100
1110 1110 0110
1000 0010 1100
[code]
Rotating is a little bit trickier, but I'm sure you'll find out. If not, ask.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.