Results 1 to 2 of 2

Thread: Creating SHAPES with code.. . . .

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    SC
    Posts
    1

    Question Creating SHAPES with code.. . . .

    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

    Eddie Lord

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width