用VC++mfc实现俄罗斯方块的程序详解(14)

2025-04-27

}

}

m_iStartX+(ActiveStatus[i][1]+1)*m_iLarge+5, m_iStartY+(ActiveStatus[i][0]+1)*m_iLarge);

//InvalidateRect(&rect); Invalidate(FALSE);

// 内部函数:当前方块下降加速,左移,右移 void CSkyblue_RectView::RectArrow(int m_Type) {

//获取当前下坠物4个小方块的位置坐标 int x1,x2,x3,x4,y1,y2,y3,y4; x1 = ActiveStatus[0][0]; x2 = ActiveStatus[1][0]; x3 = ActiveStatus[2][0]; x4 = ActiveStatus[3][0]; y1 = ActiveStatus[0][1]; y2 = ActiveStatus[1][1]; y3 = ActiveStatus[2][1]; y4 = ActiveStatus[3][1];

//对不同的移动命令指示进行分类实现 switch(m_Type) {

case LEFT:

//对每种不同的移动命令指示特性作相应的可移动分析 if ( (ActiveStatus[0][1]>0) && IsLeftLimit() && !m_isBottom) { } break;

if ( (ActiveStatus[3][1]< m_iCol-1) && IsRightLitmit() && !m_isBottom) {

//清原来的方块

GameStatus[x1][y1]=MAP_STATE_EMPTY; GameStatus[x2][y2]=MAP_STATE_EMPTY; GameStatus[x3][y3]=MAP_STATE_EMPTY; GameStatus[x4][y4]=MAP_STATE_EMPTY;

//添加新的移动后数据状态

ActiveStatus[0][1] -= 1; ActiveStatus[1][1] -= 1; ActiveStatus[2][1] -= 1; ActiveStatus[3][1] -= 1;

GameStatus[x1][y1-1]=MAP_STATE_NOT_EMPTY; GameStatus[x2][y2-1]=MAP_STATE_NOT_EMPTY; GameStatus[x3][y3-1]=MAP_STATE_NOT_EMPTY; GameStatus[x4][y4-1]=MAP_STATE_NOT_EMPTY; InvalidateCurrent();

case RIGHT:


用VC++mfc实现俄罗斯方块的程序详解(14).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2-云计算应用和业务模式

相关阅读
本类排行
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 7

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219