Thread: Tetris game

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    Tetris game

    Hi.
    Im making a tetrisgame with win32API/OpenGL.
    I have figured out much of the logic.
    I have divided the OpenGLWindow into squares, which equals to ONE piece of a BOOL-two dimension array.

    So I can do simply like this in my functions:
    (TRUE equals to "is a block here")
    (FALSE equals to "it is not a block here")

    Code:
    Render() {
    if(Logic->GetTableIsTrue(tableX,tableY)) {
    *Paint the equal square in the openGLwindow*
    }
    }
    And when I need to drop in new blocks, i can simply do:
    Code:
    Logic->SetaTabletoTrue(tableX,tableY);
    And when I need to move the blocks down pr secound, I simply do this:
    Code:
    if(Logic->GetTableIsTrue(tableX,tableY) && (tableY != 0)) {
    *move the blocks one down, simply setting the starting block to false, and set the current tableY-1 to true*
    }
    What I cant figure out, is how to make the whole FIGURE freeze...
    If a parts of a figure, hits another figure, the whole figure shall freeze there, as in normal tetris, but here, only the colisioned block are stopping. The other meets no IsTableTrue() beneath them, and continues to fall.

    How to solve this as easy as possible?
    Last edited by Da-Nuka; 01-16-2005 at 11:28 AM.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    You've been here long enough to know how to use code tags - use them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please comment on my c++ game
    By MegaManZZ in forum Game Programming
    Replies: 10
    Last Post: 01-22-2008, 11:03 AM
  2. craps game & dice game..
    By cgurl05 in forum C Programming
    Replies: 3
    Last Post: 03-25-2006, 07:58 PM
  3. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 04:19 AM
  4. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM
  5. tetris game
    By mrt in forum Game Programming
    Replies: 2
    Last Post: 04-08-2002, 10:01 AM