About Tetris game
-
hi i write a Tetris. i have completed it about 60%. main problem is that how can i bound the border of windows that block can't pass it. another problem is their moving. They shouldn't collision with together. how can i do that? sorry for poor english
#Mojtaba Karimi#
-
hi i write a Tetris. i have completed it about 60%. main problem is that how can i bound the border of windows that block can't pass it. another problem is their moving. They shouldn't collision with together. how can i do that? sorry for poor english
#Mojtaba Karimi#
both questions have one answer: i guess you re-draw tetris blocks each time they move, using rectangles (
RECT
structure) of the block parts. so what you have to do is to check if left-most,right-most and bottom-most rectangles are inside the main window rectangle. also, the block should stop moving when the bottom-most rectangle of it touches the top-most block's rectangle on the same game column (each block part is one column wide). you can get the rectangle of the main window usingGetWindowRect()
function. but don't forget to use,ClientToScreen()
andClientToParent()
functions when needed, they save more than just time. -
hi i write a Tetris. i have completed it about 60%. main problem is that how can i bound the border of windows that block can't pass it. another problem is their moving. They shouldn't collision with together. how can i do that? sorry for poor english
#Mojtaba Karimi#