SFML community forums
Help => Graphics => Topic started by: Devil0150 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).
-
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.