예제 #1
0
파일: tetris.cpp 프로젝트: milon/Tetris
void RemoveLine(int LineNumber)
{	int i,j;
	int count=0;
	int Temp[COLS];
	for(i=0; i<COLS; i++)
	{   Temp[i]=ScreenLayout[i][LineNumber];    //assign value to temp
	}
	for(j=0; j<10; j++)
	{	for(i=0; i<COLS; i++)               //for dazzling filled line
		{  ScreenLayout[i][LineNumber]=(count ? Temp[i] : BLANK);    //if count value 0 set temp value else set 0 to ScreenLayout
		}
		count = !count;       //reverse count value
		UpdateScreen();
		delay(50);
	}
	for(i=LineNumber; i>0; i--)
	   for(j=0; j<COLS; j++)
	   {	  ScreenBackgroundLayout[j][i] = ScreenBackgroundLayout[j][i-1];    //move down all blocks to fill the blank space
	   }
	for(j=0; j<COLS; j++)
	   ScreenBackgroundLayout[j][0] = BLANK;     //assign value 0 to top most line
	for(i=0; i<COLS; i++)
	   for(j=0; j<ROWS; j++)
		  ScreenLayout[i][j] = ScreenBackgroundLayout[i][j];     //assign value to ScreenLayout for display
	++LinesCleared;
	PrintLinesCleared();
	if(!(LinesCleared % 20))    //if 20 line cleared increase speed
	   IncreaseSpeed();
}
예제 #2
0
void HK_IncreaseSpeed(int, bool justPressed) { IncreaseSpeed(); }