Thread: opengl game.need help in timer(or something)

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    18

    opengl game.need help in timer(or something)

    hello.
    i'm new to opengl.i'm making a game similar to tetris and i don't know how to make the pieces come down automatically.please help...

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Tetris normally falls in increments:

    Code:
    void Game::Update(float timeDelta)
    {
       m_elapsed += timeDelta;
       if (m_elapsed >= m_blockFallTime)
       {
           m_elapsed -= m_blockFallTime;
    
           // Tell current piece to fall down
           m_currentPiece.Fall()
       }
       ....
    }

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    18
    thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help fixing my game timer FPS function
    By Anddos in forum Game Programming
    Replies: 3
    Last Post: 04-02-2012, 05:34 PM
  2. Timer for C++ console reflex game
    By Mariano L Gappa in forum C++ Programming
    Replies: 10
    Last Post: 11-27-2005, 11:10 PM
  3. opengl Game programming
    By linuxdude in forum Game Programming
    Replies: 5
    Last Post: 08-12-2004, 03:04 PM
  4. Replies: 4
    Last Post: 08-13-2003, 07:25 PM