Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Tetris, need a little help  (Read 1802 times)

0 Members and 1 Guest are viewing this topic.

Devil0150

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Tetris, need a little help
« on: June 19, 2009, 06:37:56 pm »
I am making my tetris game and i don't know how to check if the line is full and if i have to remove it, and when i remove it, how to bring the upper blocks down.
I would need to know if there's some function or something to get the color of a pixel in the screen(check if a row is full) and some other function to change the color of a part of the screen(change the color of the row to be removed before removing it), and move down a part of the screen(move the rest of the blocks down when a row of blocks is removed).

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Tetris, need a little help
« Reply #1 on: June 19, 2009, 07:43:52 pm »
You should rather separate graphics and logics than directly accessing to graphics (pixels) in order to determine the game logic (block behaviour).

A possibility is to store the blocks in a two-dimensional STL container.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: