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")
And when I need to drop in new blocks, i can simply do:Code:Render() { if(Logic->GetTableIsTrue(tableX,tableY)) { *Paint the equal square in the openGLwindow* } }
And when I need to move the blocks down pr secound, I simply do this:Code:Logic->SetaTabletoTrue(tableX,tableY);
What I cant figure out, is how to make the whole FIGURE freeze...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* }
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?
![]()



LinkBack URL
About LinkBacks



