俄罗斯方块里 给方块设置动态数组是怎么设置的 下面的代码我看不明白 什么0,5,2,1,4 这些数字代表了什么意义?
void CHWRECTView::RectStatusToActiveStatus(int m_which)
{
switch(m_which)
{
case 1:
ActiveStatus[0][0] = 0; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 1; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 2; ActiveStatus[2][1] = 5; ActiveStatus[3][0] = 3; ActiveStatus[3][1] = 5;
break;
case 2:
ActiveStatus[0][0] = 0; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 1; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 0; ActiveStatus[2][1] = 6; ActiveStatus[3][0] = 1; ActiveStatus[3][1] = 6;
break;
case 3:
ActiveStatus[0][0] = 1; ActiveStatus[0][1] = 4; ActiveStatus[1][0] = 0; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 1; ActiveStatus[2][1] = 5; ActiveStatus[3][0] = 1; ActiveStatus[3][1] = 6;
break;
case 4:
ActiveStatus[0][0] = 0; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 1; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 1; ActiveStatus[2][1] = 6; ActiveStatus[3][0] = 2; ActiveStatus[3][1] = 6;
break;
case 5:
ActiveStatus[0][0] = 1; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 2; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 0; ActiveStatus[2][1] = 6; ActiveStatus[3][0] = 1; ActiveStatus[3][1] = 6;
break;
case 6:
ActiveStatus[0][0] = 0; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 0; ActiveStatus[1][1] = 6;
ActiveStatus[2][0] = 1; ActiveStatus[2][1] = 6; ActiveStatus[3][0] = 2; ActiveStatus[3][1] = 6;
break;
case 7:
ActiveStatus[0][0] = 0; ActiveStatus[0][1] = 5; ActiveStatus[1][0] = 1; ActiveStatus[1][1] = 5;
ActiveStatus[2][0] = 2; ActiveStatus[2][1] = 5; ActiveStatus[3][0] = 0; ActiveStatus[3][1] = 6;
break;
}
}
/* * * * * * * * * * * * * * * * * * * * * *
* 内部函数:初始掉落时,将根据方块的样式决定下一次将要掉下来的动态数组的值
*
* 最后修改日期:1999.1.22
* * * * * * * * * * * * * * * * * * * * * */
void CHWRECTView::RectStatusToNextStatus(int m_which)
{
switch(m_which)
{
case 1:
NextStatus[0][0] = 0; NextStatus[0][1] = 1; NextStatus[1][0] = 1; NextStatus[1][1] = 1;
NextStatus[2][0] = 2; NextStatus[2][1] = 1; NextStatus[3][0] = 3; NextStatus[3][1] = 1;
break;
case 2:
NextStatus[0][0] = 0; NextStatus[0][1] = 1; NextStatus[1][0] = 1; NextStatus[1][1] = 1;
NextStatus[2][0] = 0; NextStatus[2][1] = 2; NextStatus[3][0] = 1; NextStatus[3][1] = 2;
break;
case 3:
NextStatus[0][0] = 1; NextStatus[0][1] = 0; NextStatus[1][0] = 0; NextStatus[1][1] = 1;
NextStatus[2][0] = 1; NextStatus[2][1] = 1; NextStatus[3][0] = 1; NextStatus[3][1] = 2;
break;
case 4:
NextStatus[0][0] = 0; NextStatus[0][1] = 1; NextStatus[1][0] = 1; NextStatus[1][1] = 1;
NextStatus[2][0] = 1; NextStatus[2][1] = 2; NextStatus[3][0] = 2; NextStatus[3][1] = 2;
break;
case 5:
NextStatus[0][0] = 1; NextStatus[0][1] = 1; NextStatus[1][0] = 2; NextStatus[1][1] = 1;
NextStatus[2][0] = 0; NextStatus[2][1] = 2; NextStatus[3][0] = 1; NextStatus[3][1] = 2;
break;
case 6:
NextStatus[0][0] = 0; NextStatus[0][1] = 1; NextStatus[1][0] = 0; NextStatus[1][1] = 2;
NextStatus[2][0] = 1; NextStatus[2][1] = 2; NextStatus[3][0] = 2; NextStatus[3][1] = 2;
break;
case 7:
NextStatus[0][0] = 0; NextStatus[0][1] = 1; NextStatus[1][0] = 1; NextStatus[1][1] = 1;
NextStatus[2][0] = 2; NextStatus[2][1] = 1; NextStatus[3][0] = 0; NextStatus[3][1] = 2;
break;
}
}