opengl game.need help in timer(or something)

This is a discussion on opengl game.need help in timer(or something) within the Game Programming forums, part of the General Programming Boards category; hello. i'm new to opengl.i'm making a game similar to tetris and i don't know how to make the pieces ...

  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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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, 06: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, 04:04 PM
  4. Replies: 4
    Last Post: 08-13-2003, 08:25 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21