各位大虾谁有俄罗斯方块下载(联机版)的源码给我一个啊,要j...

上传一个自己编的俄罗斯方块,请指点谢谢 - LabVIEW论坛 -
中国电子技术论坛 -
最好最受欢迎电子论坛!
后使用快捷导航没有帐号?
上传一个自己编的俄罗斯方块,请指点谢谢
23:44:58  
压缩包里放的版本的两份
23:44 上传
点击文件名下载附件
下载积分: 积分 -1 分
393.13 KB, 下载次数: 187, 下载积分: 积分 -1 分
23:47:10  
忘了说了,左右箭头移位,下箭头到底,空格为旋转
08:34:40  
不会看看。。。。。。。。。。
14:25:30  
支持下,支持下
16:53:01  
楼主的程序结构比较简洁,界面也很漂亮。不过这个程序有些问题就是,在左右移动和变形的时候并没有下落,而且在两侧边缘变形有时会出了格子,另外按键长按无效。我最近也写了一个俄罗斯方块的LabVIEW程序,目前还有一点小bug。当时因为没想好怎么用事件结构处理移动时下落的问题,最后舍弃了事件结构,单纯用了循环。共勉
00:28:53  
多谢5楼兄弟指点
22:14:44  
我是新手,我要努力学习,谢谢搂住分享
助理工程师
22:32:24  
& && && && && && && && && && && && && &
高级工程师
14:48:29  
20:13:38  
请教下,旋转的算法是什么。麻烦请大神给讲一下。。。。
20:14:02  
太感谢了。。。。。。
10:35:00  
好好好好好好好好好好
11:32:02  
我是新手,我要努力学习,谢谢搂住分享
21:16:04  
都到处找了好久了,看看怎么写的,刚学。。。
21:16:15  
都到处找了好久了,看看怎么写的,刚学
22:32:16  
谢谢!!!!!!!!!!!!!!!!!!!
08:22:13  
下载学习学习
助理工程师
08:29:16  
09:51:04  
15:41:33  
Powered by&&&&VC版双人俄罗斯方块源代码
VC版双人俄罗斯方块源代码
VC版双人俄罗斯方块源代码!有音乐、画面优美!
若举报审核通过,可奖励20下载分
被举报人:
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动色情等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
VIP下载&&免积分60元/年(1200次)
您可能还需要
开发技术下载排行关键字:    
当前位置: >
俄罗斯方块源码
详细介绍 - [ 俄罗斯方块源码 ]
俄罗斯方块源码简介:
俄罗斯方块源码里面有三个模块,一个简单版,一个复杂版,还有一个扫雷。复杂版的可以暂停游戏还可以更换游戏背景跟主题。&&
下载地址 - [ 俄罗斯方块源码 ]
推荐使用、下载,请使用解压文件;
下载本站资源,如服务器暂不能下载请过一段时间再试;
本站资源通过 、 等软件检测;
本站部分资源供学习交流使用,如商业用途,请购正版。
网友对“俄罗斯方块源码”的评论
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
& 下一篇:
您喜欢这个源码么?
本类热门源码
增值电信业务经营许可证:苏B2-CopyRight ©
All Rights reserved.俄罗斯方块源代码
俄罗斯方块源代码
/*-------------------------------------------------RussianBlock.c -- 俄罗斯方块,参照了以下代码CHECKER1.C -- Mouse Hit-Test Demo Program No. 4(c) Charles Petzold, 1998(C) LZH , 日-------------------------------------------------*/#include&& &stdio.h& //包含标准输入输出库文件 #include &windows.h& //包含WINDOWS.H头文件#include &time.h&& //包含TIME.H时间处理函数#include "EZFont.h"#define Max(a,b) a&b?a:b#define Min(a,b) a&b?a:bint i,j,next,idF //i,j用于记录图形块状态;next用于记录下一个图形块,idFocus定义窗口焦点。//定义一个储存绘画图形块的点结构三维数组POINT BlockPoint[7][4][10] = {&{&&{4,-2,5,-2,6,-2,6,-1,6,0,5,0,4,0,4,-1}&},&{&&{4,-2,5,-2,6,-2,7,-2,7,-1,6,-1,5,-1,5,0,4,0,4,-1},&&{5,-3,6,-3,6,-2,6,-1,7,-1,7,0,6,0,5,0,5,-1,5,-2},&&{6,-3,7,-3,7,-2,7,-1,6,-1,5,-1,4,-1,4,-2,5,-2,6,-2},&&{4,-3,5,-3,6,-3,6,-2,6,-1,6,0,5,0,5,-1,5,-2,4,-2}&&& },&{&&&&&&& {4,-2,5,-2,6,-2,7,-2,7,-1,7,0,6,0,6,-1,5,-1,4,-1},&&{5,-3,6,-3,7,-3,7,-2,6,-2,6,-1,6,0,5,0,5,-1,5,-2},&&{4,-3,5,-3,5,-2,6,-2,7,-2,7,-1,6,-1,5,-1,4,-1,4,-2},&&{5,-3,6,-3,6,-2,6,-1,6,0,5,0,4,0,4,-1,5,-1,5,-2}&&& },&{&&{4,-2,5,-2,6,-2,6,-1,7,-1,7,0,6,0,5,0,5,-1,4,-1},&&{5,-3,6,-3,6,-2,6,-1,5,-1,5,0,4,0,4,-1,4,-2,5,-2}&&& },&{&&{5,-2,6,-2,7,-2,7,-1,6,-1,6,0,5,0,4,0,4,-1,5,-1},&&{4,-3,5,-3,5,-2,6,-2,6,-1,6,0,5,0,5,-1,4,-1,4,-2}&&& },&{&&{4,-2,5,-2,6,-2,7,-2,7,-1,6,-1,6,0,5,0,5,-1,4,-1},&&{5,-3,6,-3,6,-2,7,-2,7,-1,6,-1,6,0,5,0,5,-1,5,-2},&&{5,-3,6,-3,6,-2,7,-2,7,-1,6,-1,5,-1,4,-1,4,-2,5,-2},&&{5,-3,6,-3,6,-2,6,-1,6,0,5,0,5,-1,4,-1,4,-2,5,-2}&&& },&{&&{4,-1,5,-1,6,-1,7,-1,8,-1,8,0,7,0,6,0,5,0,4,0},&&{5,-2,6,-2,6,-1,6,0,6,1,6,2,5,2,5,1,5,0,5,-1}&}};POINT mPoint[10] = {0,0} ;//用于记录移动后的图形点POINT nextPoint[10] = {0,0};//用于记录下一个图形点int x,y;//用于记录图形块坐标//游戏失败标志int pause = 0 ;//游戏暂停标志int grade = 0 ;//游戏级别标志int moment1 = 0 ;//游戏级别显示标志int moment2 = 0 ;//游戏级别显示标志int score,level,& //score用于记录分数,level用于记录关卡,start用于标记游戏开始WNDPROC OldButton[2] ;//定义回调函数数组.LRESULT CALLBACK ButtonProc (HWND, UINT, WPARAM, LPARAM) ;//声明窗口控件回调函数.LRESULT CALLBACK WndProc&& (HWND, UINT, WPARAM, LPARAM) ;//声明主窗口回调函数int printWord(HDC hdc,TCHAR szFileName[]);//声明打印文字函数int leftMove(int show[10][22],HWND hwnd);//声明图形块左移函数int rightMove(int show[10][22],HWND hwnd);//声明图形块右移函数int downMove(int show[10][22],HWND hwnd);//声明图形块下移函数int rotateBlock(HWND hwnd,int show[10][22]);//声明图形块旋转函数int paintBlock(HDC hdc);//声明图形块绘画函数int showRect(HWND hwnd,HDC hdc,int show[10][22]);//声明矩形显示函数& int initGame(HWND hwnd,int show[10][22]);//声明游戏初始化函数int initBlock();//声明图形块初始化函数int destroyBlock(HWND hwnd,int show[10][22]);//声明图形块消除函数int oneBlock(HWND hwnd,int show[10][22]);//声明第一种图形块处理函数int twoBlock(HWND hwnd,int show[10][22]);//声明第二种图形块处理函数int threeBlock(HWND hwnd,int show[10][22]);//声明第三种图形块处理函数int fourBlock(HWND hwnd,int show[10][22]);//声明第四种图形块处理函数int fiveBlock(HWND hwnd,int show[10][22]);//声明第五种图形块处理函数int sixBlock(HWND hwnd,int show[10][22]);//声明第六种图形块处理函数int sevenBlock(HWND hwnd,int show[10][22]);//声明第七种图形块处理函数//定义主窗口函数int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,&&&&&&&&&&&&&&&&&&& PSTR szCmdLine, int iCmdShow){&static TCHAR szAppName[] = TEXT ("RussianBlock") ;&HWND&&&&&&&&&MSG&&&&&&&&&&WNDCLASS&&&&&&wndclass.style&&&&&&&& = CS_HREDRAW | CS_VREDRAW ;&wndclass.lpfnWndProc&& = WndP&wndclass.cbClsExtra&&& = 0 ;&wndclass.cbWndExtra&&& = 0 ;&wndclass.hInstance&&&& = hI&wndclass.hIcon&&&&&&&& = LoadIcon (hInstance,szAppName) ;&wndclass.hCursor&&&&&& = LoadCursor (NULL, IDC_ARROW) ;&wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;&wndclass.lpszMenuName& = NULL ;&wndclass.lpszClassName = szAppN&&if (!RegisterClass (&wndclass))&{&&MessageBox (NULL, TEXT ("Program requires Windows NT!"), &&&szAppName, MB_ICONERROR) ;&&return 0 ;&}&&RegisterClass (&wndclass) ;&&hwnd = CreateWindow (szAppName, TEXT ("RussianBlock"),&&WS_SYSMENU | WS_OVERLAPPED ,&&CW_USEDEFAULT, CW_USEDEFAULT,&&382, 468,&&NULL, NULL, hInstance, NULL) ;&&ShowWindow (hwnd, iCmdShow) ;&UpdateWindow (hwnd) ;&&while (GetMessage (&msg, NULL, 0, 0))&{&&TranslateMessage (&msg) ;&&DispatchMessage (&msg) ;&}&return msg.wP}//定义主窗口回调函数LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){&static int show[10][22] = {0};//定义记录图形块删除标志&int&&& cxChar=0,cyChar=0 ;&TCHAR&&&&&&& szFileName [MAX_PATH];//定义一个储存输出文字的字符数组&HDC&&&&&&&&&&PAINTSTRUCT&&&&&&&&&static HWND& hwndButton[2] ;&&int m=0 ;&&switch (message)&{&case WM_CREATE :&&for (i=0;i&2;i++)&&{&&&hwndButton[i] = CreateWindow&&&&( TEXT("button"),TEXT("开始"),&&&&WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON,&&&&0,0,0,0,&&&&hwnd, (HMENU) i,&&&&((LPCREATESTRUCT) lParam)-&hInstance, NULL) ;&&&OldButton[i] = (WNDPROC) SetWindowLong (hwndButton[i],&&&&GWL_WNDPROC, (LONG) ButtonProc) ;&&}&&SetWindowText(hwndButton[1],TEXT("关闭"));&&&&return 0 ;&&&case WM_SIZE :&&&&cxChar = LOWORD (GetDialogBaseUnits ()) ;&&cyChar = HIWORD (GetDialogBaseUnits ()) ;&&&&MoveWindow (hwndButton[0],&&&221 + 1 * cxChar, &&&440 - 11 * cyChar/4,&&&6 * cxChar, 7 * cyChar/4, TRUE) ;&&MoveWindow (hwndButton[1],&&&221 + 11 * cxChar, &&&440 - 11 * cyChar/4,&&&6 * cxChar, 7 * cyChar/4, TRUE) ;&&&&return 0 ;&&&case WM_SETFOCUS ://取得窗口焦点时的消息&&SetFocus (hwndButton[idFocus]) ;//当主窗口取得焦点时设置子窗口控件为焦点;&&return 0 ;&case WM_COMMAND:&&switch (LOWORD (wParam))&&{&&case 0:&&&initGame(hwnd,show);&&&&&case 1:&&&KillTimer(hwnd,1);&&&PostQuitMessage (0) ;&&&&&}&&return 0;&&&case WM_TIMER:&&&if(start && !pause)&&&{&&&&&&&&downMove(show,hwnd);//处理图形块下移&&&&&&&}&&&return 0;&&&&case WM_KEYDOWN:&&&switch (wParam)&&&{&&&&&&&case VK_DOWN:&&&&if(start && !pause)&&&&{&&&&&&&&&&downMove(show,hwnd);//处理图形块下移&&&&&&&&&&&&&&&&&&& &&&&}&&&&&&&&&&&&&&&& case VK_LEFT:&&&&if(start && !pause)&&&&{&&&&&&&&&&leftMove(show,hwnd) ;//处理图形块左移&&&&&&&&&}&&&&&&&&&&&case VK_RIGHT:&&&&if(start && !pause)&&&&{&&&&&&&&&&rightMove(show,hwnd);//处理图形块右移&&&&&&&&&}&&&&&&&&&&&case VK_UP:&&&&&&&&if(start && !pause)&&&&&&&& rotateBlock(hwnd,show);//处理图形块旋转&&&&&&&&&&&&&&&case 'Z':&&&case 'z' :&&&&if(start && !pause)&&&&&&&&&&&&&&& if(GetKeyState (VK_CONTROL) & 0)&&&&&score += 300 ;&&&&&&&&&&case 'P' :&&&case 'p' :&&&&if(start)&&&&& pause ^=1 ;&&&&&&&&&&case 'D':&&&case 'd':&&&&if(start && !pause)&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&&&&&& show[m][21] = 1 ;&&&& &&&&&&}&&&&&&return 0 ;&&case WM_PAINT:&&&&hdc = BeginPaint (hwnd, &ps) ;&&&&SetMapMode (hdc, MM_ANISOTROPIC) ;//设置图形映射模式&&&&SetWindowExtEx (hdc, 1, 1, NULL) ;&&&&& &&&&SetViewportExtEx (hdc, 20, 20, NULL) ;&&&&showRect(hwnd,hdc,show);//让图形块在终点位置显示&&&&printWord(hdc,szFileName);//输出文字&&&&if(start)&&&&&paintBlock(hdc);//显示图形块&&&&EndPaint (hwnd, &ps) ;&&&&return 0 ;&&&&&&& case WM_DESTROY :&&&&KillTimer(hwnd,1);&&&&PostQuitMessage (0) ;&&&&return 0 ;&&& }&&&& return DefWindowProc (hwnd, message, wParam, lParam) ;}//定义左移函数int leftMove(int show[10][22],HWND hwnd){&int m=0,n=0 ;&switch(i)&{&case 0://处理正方形方块&&m = mPoint[0].&&n = mPoint[0].&&if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0)&&{&&&&& x -= 1 ;&&&&&&&&&&& &&&for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&}&&&case 1://处理左上折方块的四种形态&&&&&&& switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0 && show[m-1][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&2 && show[m-1][n] == 0 && show[m-3][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m][n+1] == 0 && show[m][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 2://处理右上折方块的四种形态&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m+1][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0 && show[m-1][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&1 && show[m-1][n] == 0 && show[m-1][n+1] == 0 && show[m-2][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 3://处理'Z'形方块的四种形态&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&1 && show[m-1][n] == 0 && show[m-2][n+1] == 0 && show[m-2][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}
&&}&&&case 4://处理反'Z'形方块的四种形态&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&1 && show[m-1][n] == 0 && show[m-2][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0 && show[m][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}
&&}&&&case 5://处理'下'形方块的四种形态&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0 && show[m-1][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&1 && show[m-1][n] == 0 && show[m-2][n+1] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&1 && show[m-1][n] == 0 && show[m-2][n+1] == 0 && show[m-1][n+2] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 6://处理长方形方块的四种形态&&&&&&& switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&0 && show[m-1][n] == 0 && show[m-1][n+1] == 0 &&&&&& show[m-1][n+2] == 0 && show[m-1][n+3] == 0)&&&{&&&&&&& x -= 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x -= 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&}&&return 0 ;}//定义图形块右移函数int rightMove(int show[10][22],HWND hwnd){&int m=0,n=0 ;&switch(i)&{&case 0:&&m = mPoint[0].&&n = mPoint[0].&&if(m&8 && show[m+2][n] == 0 && show[m+2][n+1] == 0)&&{&&&&& x += 1 ;&&&&&&&&&&& &&&for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&}&&&case 1:&&&&&&& switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&7 && show[m+3][n] == 0 && show[m+1][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+1][n] == 0 && show[m+1][n+1] == 0 && show[m+2][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&9 && show[m+1][n] == 0 && show[m+1][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+2][n] == 0 && show[m+2][n+1] == 0 && show[m+2][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 2:&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&7 && show[m+3][n] == 0 && show[m+3][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+2][n] == 0 && show[m+1][n+1] == 0 && show[m+1][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&7 && show[m+1][n] == 0 && show[m+3][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&9 && show[m+1][n] == 0 && show[m+1][n+1] == 0 && show[m+1][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 3:&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&7 && show[m+2][n] == 0 && show[m+3][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&9 && show[m+1][n] == 0 && show[m+1][n+1] == 0 && show[m][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}
&&}&&&case 4:&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+2][n] == 0 && show[m+1][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+1][n] == 0 && show[m+2][n+1] == 0 && show[m+2][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}
&&}&&&case 5:&&switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&7 && show[m+3][n] == 0 && show[m+2][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+1][n] == 0 && show[m+2][n+1] == 0 && show[m+1][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 2:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&8 && show[m+1][n] == 0 && show[m+2][n+1] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 3:&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&9 && show[m+1][n] == 0 && show[m+1][n+1] == 0 && show[m+1][n+2] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&&&case 6:&&&&&&& switch(j)&&{&&case 0:&&&m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&6 && show[m+4][n] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&case 1:&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&9 && show[m+1][n] == 0 && show[m+1][n+1] == 0 &&&&&& show[m+1][n+2] == 0 && show[m+1][n+3] == 0)&&&{&&&&&&& x += 1 ;&&&&&&&&&&& &&&& for(m=0;m&10;m++)&&&&mPoint[m].x += 1;&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&}&}&return 0 ;}//定义图形块下移函数int downMove(int show[10][22],HWND hwnd){&&& &switch(i)&{&&& case 0:&&&& &&&& oneBlock(hwnd,show);&&&& &&&&&&& case 1:&&&& &&&& twoBlock(hwnd,show);&&&& &&&&&&&&&&&&&& &&& case 2:&&&& &&&& threeBlock(hwnd,show);&&&& &&&&&&&& &&& case 3:&&&& &&&& fourBlock(hwnd,show);&&&& &&&&&&&& &&& case 4:&&&& &&&& fiveBlock(hwnd,show);&&&& &&&&&&&& &&& case 5:&&&& &&&& sixBlock(hwnd,show);&&&& &&&&&&&& &&& case 6:&&&& &&&& sevenBlock(hwnd,show);&&&& &}&return 0 ;}//定义图形块初始化函数int initBlock(){&&&&x = 0 ;&y = 0 ;&j = 0 ;&i =&&& srand((unsigned)time(NULL));&&& next = rand () % 7 ;&&& for(m=0;m&10;m++)&{&&mPoint[m].x = BlockPoint[i][j][m].x;&&mPoint[m].y = BlockPoint[i][j][m].y;&}&for(m=0;m&10;m++)&{&&nextPoint[m].x = BlockPoint[next][0][m].x + 10 ;&&nextPoint[m].y = BlockPoint[next][0][m].y + 3 ;&}&&& &return 0 ;}//定义正方形方块下移处理函数int oneBlock(HWND hwnd,int show[10][22]){&&& int m,n;&&&&&&& &m = mPoint[5].&n = mPoint[5].&&if(n&21)&{&&m = mPoint[0].&&n = mPoint[0].&&show[m][n] = 1 ;&&show[m+1][n] = 1 ;&&show[m][n+1] = 1 ;&&show[m+1][n+1] = 1 ;&&&&& &&initBlock();&&InvalidateRect (hwnd, NULL, 1) ;&&&&destroyBlock(hwnd,show);&}&else&&if(show[m][n] == 0 && show[m-1][n] == 0)&&{&&&y += 1 ;&&&for(m=0;m&10;m++)&&&&mPoint[m].y += 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&}&&else&&&if(n&=2)&&&{&&&&&&&&m = mPoint[0].&&&&n = mPoint[0].&&&&show[m][n] = 1 ;&&&&show[m+1][n] = 1 ;&&&&show[m][n+1] = 1 ;&&&&show[m+1][n+1] = 1 ;&&&&initBlock();&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&destroyBlock(hwnd,show);&&&}&&&else&&&{&&&&KillTimer(hwnd,1);&&&&lost = 1 ;&&&&start = 0 ;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&&&&return 0 ;}//定义左上折方块下移处理函数int twoBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&case 0:&&m = mPoint[5].&&n = mPoint[5].&&if(n&0 && show[m-2][n+1] == 0)&&{&&&y += 1 ;&&&for(m=0;m&10;m++)&&&&mPoint[m].y += 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&&&&}&&if(n&20)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+2][n] = 1 ;&&&show[m][n+1] = 1 ;&&&initBlock();&&&&&&&&&&& InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n+1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=1)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+2][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&&&& &case 1:&&m = mPoint[6].&&n = mPoint[6].&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&show[m+1][n+2] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&show[m+1][n+2] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 2:&&m = mPoint[4].&&n = mPoint[4].&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m-1][n+1] = 1 ;&&&show[m-2][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m-1][n+1] = 1 ;&&&&&&&&show[m-2][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 3:&&m = mPoint[6].&&n = mPoint[6].&&&&&& if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+1][n+1] = 1 ;&&&show[m+1][n+2] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n-2] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&show[m+1][n+2] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&&&&&&& }&return 0 ;}//定义右上折方块下移处理函数int threeBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&case 0:&&m = mPoint[6].&&n = mPoint[6].&&if(n&1 && show[m][n] == 0)&&{&&&y += 1 ;&&&for(m=0;m&10;m++)&&&&mPoint[m].y += 1;&&&InvalidateRect (hwnd,NULL,0) ;&&&&&}&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+2][n] = 1 ;&&&show[m+2][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n-1] == 0 && show[m-2][n-1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+2][n] = 1 ;&&&&&&&&show[m+2][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 1:&&m = mPoint[7].&&n = mPoint[7].&&&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m+1][n-2] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 2:&&m = mPoint[6].&&n = mPoint[6].&&&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m+1][n+1] = 1 ;&&&show[m+2][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&show[m+2][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 3:&&m = mPoint[6].&&n = mPoint[6].&&&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&show[m-1][n+2] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m+1][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&show[m-1][n+2] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&&&&&&&&&}&return 0 ;}//定义Z形方块下移处理函数int fourBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&case 0:&&m = mPoint[6].&&n = mPoint[6].&&if(n&1 && show[m][n] == 0 && show[m-1][n] == 0)&&{&&&y += 1 ;&&&&&&for(m=0;m&10;m++)&&&&mPoint[m].y += 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&&&&}&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+1][n+1] = 1 ;&&&show[m+2][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n-1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&show[m+2][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 1:&&m = mPoint[6].&&n = mPoint[6].&&&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m-1][n+1] = 1 ;&&&show[m-1][n+2] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m+1][n-1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m-1][n+1] = 1 ;&&&&&&&&show[m-1][n+2] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&}&return 0 ;}//定义反Z形方块下移处理函数int fiveBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&&& case 0:&&&& m = mPoint[4].&&&& n = mPoint[4].&&&& if(n&0 && show[m-1][n+1] == 0 && show[m-2][n+1] == 0)&&&& {&&&&& y += 1 ;&&&&& for(m=0;m&10;m++)&&&&&& mPoint[m].y += 1;&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&& if(n&20)&&&& {&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&& n = mPoint[0].&&&&&&&& show[m][n] = 1 ;&&&&&&&& show[m+1][n] = 1 ;&&&&&&&& show[m][n+1] = 1 ;&&&&&&&& show[m-1][n+1] = 1 ;&&&&&&&& initBlock();&&&&&&&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 1) ;&&&&&&&& &&&&&&&& destroyBlock(hwnd,show);&&&& }&&&& else&&&&& if(show[m][n] == 0 && show[m-1][n+1] == 0 && show[m-2][n+1] == 0)&&&&& {&&&&&& y += 1 ;&&&&&& for(m=0;m&10;m++)&&&&&&& mPoint[m].y += 1;&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&&&&&&&&&&&&&&& else&&&&&&&&& if(n&=1)&&&&&&&&& {&&&&&&&&&& &&&&&&&&&& m = mPoint[0].&&&&&&&&&& n = mPoint[0].&&&&&&&&&& show[m][n] = 1 ;&&&&&&&&&& show[m+1][n] = 1 ;&&&&&&&&&& show[m][n+1] = 1 ;&&&&&&&&&& show[m-1][n+1] = 1 ;&&&&&&&&&& initBlock();&&&&&&&&&& InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&& &&&&&&&&&& destroyBlock(hwnd,show);&&&&&&&&& }&&&&&&&&& else&&&&&&&&& {&&&&&&&&&& KillTimer(hwnd,1);&&&&&&&&&& lost = 1 ;&&&&&&&&&& start = 0 ;&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&&& &&&&&&&&&&&& case 1:&&&& m = mPoint[6].&&&& n = mPoint[6].&&&& &&&& if(n&21)&&&& {&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&& n = mPoint[0].&&&&&&&& show[m][n] = 1 ;&&&&&&&& show[m][n+1] = 1 ;&&&&&&&& show[m+1][n+1] = 1 ;&&&&&&&& show[m+1][n+2] = 1 ;&&&&&&&& initBlock();&&&&&&&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 1) ;&&&&&&&& &&&&&&&& destroyBlock(hwnd,show);&&&& }&&&& else&&&&& if(show[m][n] == 0 && show[m-1][n-1] == 0)&&&&& {&&&&&& y += 1 ;&&&&&& for(m=0;m&10;m++)&&&&&&& mPoint[m].y += 1;&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&&&&&&&&&&&&&&& else&&&&&&&&& if(n&=3)&&&&&&&&& {&&&&&&&&&& &&&&&&&&&& m = mPoint[0].&&&&&&&&&& n = mPoint[0].&&&&&&&&&& show[m][n] = 1 ;&&&&&&&&&& show[m][n+1] = 1 ;&&&&&&&&&& show[m+1][n+1] = 1 ;&&&&&&&&&& show[m+1][n+2] = 1 ;&&&&&&&&&& initBlock();&&&&&&&&&& InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&& &&&&&&&&&& destroyBlock(hwnd,show);&&&&&&&&& }&&&&&&&&& else&&&&&&&&& {&&&&&&&&&& KillTimer(hwnd,1);&&&&&&&&&& lost = 1 ;&&&&&&&&&& start = 0 ;&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&&& &&&&&&&&&&}&return 0 ;}//定义'下'形方块下移处理函数int sixBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&case 0:&&m = mPoint[5].&&n = mPoint[5].&&if(n&0 && show[m-1][n+1] == 0)&&{&&&y += 1 ;&&&for(m=0;m&10;m++)&&&&mPoint[m].y += 1;&&&InvalidateRect (hwnd, NULL, 0) ;&&&&&}&&if(n&20)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+2][n] = 1 ;&&&show[m+1][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n+1] == 0 && show[m-2][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=1)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+2][n] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 1:&&m = mPoint[5].&&n = mPoint[5].&&&&if(n&20)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&show[m+1][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n+1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 2:&&m = mPoint[5].&&n = mPoint[5].&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m-1][n+1] = 1 ;&&&show[m+1][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&&&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=2)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m-1][n+1] = 1 ;&&&&&&&&show[m+1][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 3:&&m = mPoint[5].&&n = mPoint[5].&&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&show[m-1][n+1] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n-1] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=3)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&show[m-1][n+1] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&}&return 0 ;}//定义长方形方块下移处理函数int sevenBlock(HWND hwnd,int show[10][22]){&&& int m,n;&switch(j)&{&case 0:&&m = mPoint[6].&&n = mPoint[6].&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m+1][n] = 1 ;&&&show[m+2][n] = 1 ;&&&show[m+3][n] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0 && show[m-1][n] == 0 && show[m-2][n] == 0&&&&&& show[m-3][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=1)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m+1][n] = 1 ;&&&&&&&&show[m+2][n] = 1 ;&&&&&&&&show[m+3][n] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&case 1:&&m = mPoint[6].&&n = mPoint[6].&&if(n&21)&&{&&&m = mPoint[0].&&&n = mPoint[0].&&&show[m][n] = 1 ;&&&show[m][n+1] = 1 ;&&&show[m][n+2] = 1 ;&&&show[m][n+3] = 1 ;&&&initBlock();&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&destroyBlock(hwnd,show);&&}&&else&&&if(show[m][n] == 0)&&&{&&&&y += 1 ;&&&&for(m=0;m&10;m++)&&&&&mPoint[m].y += 1;&&&&InvalidateRect (hwnd, NULL, 0) ;&&&}&&&else&&&&if(n&=4)&&&&{&&&&&&&&&&&&&&&&&&&&&&&& m = mPoint[0].&&&&&&&&n = mPoint[0].&&&&&&&&show[m][n] = 1 ;&&&&&&&&show[m][n+1] = 1 ;&&&&&&&&show[m][n+2] = 1 ;&&&&&&&&show[m][n+3] = 1 ;&&&&&&&&initBlock();&&&&&&&&InvalidateRect (hwnd, NULL, 1) ;&&&&&&&&&&&&&&&&destroyBlock(hwnd,show);&&&&}&&&&else&&&&{&&&&&KillTimer(hwnd,1);&&&&&lost = 1 ;&&&&&start = 0 ;&&&&&InvalidateRect (hwnd, NULL, 0) ;&&&&}&&&&&&&&&}&return 0 ;}//定义方块旋转处理函数int rotateBlock(HWND hwnd,int show[10][22]){&int m = 0,n = 0 ;&&switch(i)&{&&&& case 0:&&&& &&&&&&&& case 1:&&&& switch(j)&&&& {&&&& case 0:&&&&&&&&&&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(n&0 && m&=0 && m&=7 && show[m][n-1] == 0 && show[m+1][n-1] == 0&&&&&& && show[m+2][n-1] == 0 && show[m+1][n+1] == 0)&&&&& {&&&&&& j += 1 ;&&&&&& j %= 4 ;&&&&&& x = Min(3,Max(-5,x)) ;&&&&&& y = Min(22,y) ;&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&&&&&&& case 1:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 && show[m-1][n+1] == 0&&&&&& && show[m+1][n] == 0 && show[m+1][n+1] == 0)&&&&& {&&&&&& j += 1 ;&&&&&& j %= 4 ;&&&&&& x = Min(3,Max(-4,x)) ;&&&&&& y = Min(23,y) ;&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&&&&&&& case 2:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&=2 && m&=9 && show[m-1][n] == 0 && show[m-2][n] == 0&&&&&& && show[m-1][n-2] == 0 && show[m-2][n-2] == 0)&&&&& {&&&&&& j += 1 ;&&&&&& j %= 4 ;&&&&&& x = Min(4,Max(-4,x)) ;&&&&&& y = Min(22,y) ;&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&&&&&&& case 3:&&&&& m = mPoint[0].&&&&& n = mPoint[0].&&&&& if(m&=0 && m&=7 && show[m][n+1] == 0 && show[m][n+2] == 0&&&&&& && show[m+2][n+1] == 0 && show[m+2][n+2] == 0)&&&&& {&&&&&& j += 1 ;&&&&&& j %= 4 ;&&&&&& x = Min(3,Max(-4,x)) ;&&&&&& y = Min(22,y) ;&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&& }&&&& }&&&&&case 2:&&&&& switch(j)&&&&& {&&&&& case 0:&&&&&& m = mPoint[0].&&&&&&&&& n = mPoint[0].&&&&&&&&& if(n&0 && m&=0 && m&=7 && show[m+1][n-1] == 0 && show[m+2][n-1] == 0&&&&&&&&&&& && show[m][n+1] == 0 && show[m+1][n+1] == 0)&&&&&& {&&&&&&&&& j += 1 ;&&&&&&&&& j %= 4 ;&&&&&&&&& x = Min(3,Max(-5,x)) ;&&&&&&&&& y = Min(22,y) ;&&&&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&& }&&&&&&&&&&& case 1:&&&&&& m = mPoint[0].&&&&&&&&& n = mPoint[0].&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 && show[m-1][n+1] == 0&&&&&&&&&&& && show[m+1][n+1] == 0 && show[m+1][n+2] == 0)&&&&&& {&&&&&&&&& j += 1 ;&&&&&&&&& j %= 4 ;&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&& y = Min(23,y) ;&&&&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&& }&&&&&&&&&&& case 2:&&&&&& m = mPoint[0].&&&&&&&&& n = mPoint[0].&&&&&&&&& if(m&=0 && m&=7 && show[m+1][n] == 0 && show[m+2][n] == 0&&&&&&&&&&& && show[m][n+2] == 0 && show[m+1][n+2] == 0)&&&&&& {&&&&&&&&& j += 1 ;&&&&&&&&& j %= 4 ;&&&&&&&&& x = Min(4,Max(-4,x)) ;&&&&&&&&& y = Min(22,y) ;&&&&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&& }&&&&&&&&&&& case 3:&&&&&& m = mPoint[0].&&&&&&&&& n = mPoint[0].&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 && show[m-1][n+1] == 0&&&&&&&&&&& && show[m+1][n+1] == 0 && show[m+1][n+2] == 0)&&&&&& {&&&&&&&&& j += 1 ;&&&&&&&&& j %= 4 ;&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&& y = Min(22,y) ;&&&&&&&&& for(m=0;m&10;m++)&&&&&& {&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&& }&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&& }&&&&& }&&&&&&case 3:&&&&&& switch(j)&&&&&& {&&&&&& case 0:&&&&&&& m = mPoint[0].&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&& if(n&0 && m&=0 && m&=7 && show[m][n-1] == 0 && show[m+1][n-1] == 0&&&&&&&&&&&&&&&& && show[m][n+1] == 0)&&&&&&& {&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&& x = Min(4,Max(-4,x)) ;&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&& {&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&& }&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&& }&&&&&&&&&&&&& case 1:&&&&&&& m = mPoint[0].&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 && show[m][n+2] == 0&&&&&&&&&&&&&&&& && show[m+1][n+2] == 0)&&&&&&& {&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&& {&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&& }&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&& }&&&&&&& &&&&&& }&&&&&&&case 4:&&&&&&& switch(j)&&&&&&& {&&&&&&& case 0:&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&& if(n&0 && m&=1 && m&=8 && show[m-1][n-1] == 0 && show[m-1][n] == 0&&&&&&&&&&&&&&&&&&& && show[m+1][n+1] == 0)&&&&&&&& {&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&&&&& x = Min(4,Max(-4,x)) ;&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&& {&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&& }&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&& }&&&&&&&&&&&&&&& case 1:&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&& if(m&=0 && m&=7 && show[m][n+2] == 0 && show[m+2][n+1] == 0&&&&&&&&&&&&&&&&&&& && show[m+2][n+2] == 0)&&&&&&&& {&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&& {&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&& }&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&& }&&&&&&& }&&&&&&&& &&&&&&&& &&&&&&&&&& case 5:&&&&&&&& switch(j)&&&&&&&& {&&&&&&&& case 0:&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&& if(n&0 && m&=0 && m&=7 && show[m+1][n-1] == 0 &&&&&&&&& && show[m+2][n-1] == 0 && show[m][n+1] == 0 &&&&&&&&& && show[m+2][n+1] == 0)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&& j %= 4 ;&&&&&&&&&&&&&&&&&&&& x = Min(3,Max(-5,x)) ;&&&&&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&& {&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&& }&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&&&&&&&&&&& case 1:&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 &&&&&&&&& && show[m-1][n+1] == 0 && show[m+1][n] == 0 &&&&&&&&& && show[m+1][n+2] == 0)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&& j %= 4 ;&&&&&&&&&&&&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&&&&&&&&&&&&& y = Min(23,y) ;&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&& {&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&& }&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&&&&&&&&&&& case 2:&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 &&&&&&&&& && show[m-1][n+2] == 0 && show[m][n+2] == 0 &&&&&&&&& && show[m+1][n] == 0)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&& j %= 4 ;&&&&&&&&&&&&&&&&&&&& x = Min(4,Max(-4,x)) ;&&&&&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&& {&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&& }&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&&&&&&&&&&& case 3:&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&& if(m&=1 && m&=8 && show[m-1][n] == 0 &&&&&&&&& && show[m-1][n+2] == 0 && show[m+1][n+1] == 0 &&&&&&&&& && show[m+1][n+2] == 0)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&& j %= 4 ;&&&&&&&&&&&&&&&&&&&& x = Min(3,Max(-4,x)) ;&&&&&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&& {&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&& }&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&& }&&&&&&&& }&&&&&&&&&&& case 6:&&&&&&&&& switch(j)&&&&&&&&& {&&&&&&&&& case 0:&&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&&&&&& if(n&0 && m&=0 && m&=6 && show[m][n-1] == 0 && show[m+1][n-1] == 0&&&&&&&&&&&&& && show[m+1][n+1] == 0 && show[m+2][n+1] == 0 && show[m+3][n+1] == 0& &&&&&&&&&&&&& && show[m+1][n+2] == 0&& show[m+2][n+2] == 0 && show[m+3][n+2] == 0)&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&&&&&&&&&&&&& x = Min(4,Max(-5,x)) ;&&&&&&&&&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&&& }&&&&&&&&&&&&&&&&&&& case 1:&&&&&&&&&& m = mPoint[0].&&&&&&&&&&&&&&&&&&&&&&&&& n = mPoint[0].&&&&&&&&&&&&&&&&&&&&&&&&& if(m&=1 && m&=7 && show[m-1][n] == 0 && show[m-1][n+1] == 0&&&&&&&&&&&&& && show[m+1][n+1] == 0 && show[m+1][n+2] == 0 && show[m+1][n+3] == 0& &&&&&&&&&&&&& && show[m+2][n+1] == 0&& show[m+2][n+2] == 0 && show[m+2][n+3] == 0)&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&& j += 1 ;&&&&&&&&&&&&&&&&&&&&&&&& j %= 2 ;&&&&&&&&&&&&&&&&&&&&&&&& x = Min(2,Max(-4,x)) ;&&&&&&&&&&&&&&&&&&&&&&&& y = Min(22,y) ;&&&&&&&&&&&&&&&&&&&&&&&& for(m=0;m&10;m++)&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&& mPoint[m].x = BlockPoint[i][j][m].x +&&&&&&&&&&&&&&&&&&&&&&& mPoint[m].y = BlockPoint[i][j][m].y +&&&&&&&&& }&&&&&&&&&&&&&&&&&&&&&&&& InvalidateRect (hwnd, NULL, 0) ;&&&&&&&&&& }&&&&&&&&&& &&&&&&&&&& &&&&&&&&& }&&&&&&&&& &}&return 0 ;}//定义图形块绘画函数int paintBlock(HDC hdc){&&& int iC&if(i==0)&&iCount = 8 ;&else&&iCount = 10 ;&&& SelectObject (hdc, GetStockObject (WHITE_BRUSH)) ;&Polygon(hdc,mPoint,iCount);&if(next==0)&&iCount = 8 ;&else&&iCount = 10 ;&&& Polygon(hdc,nextPoint,iCount);&return 0 ;}//定义图形块终点位置显示函数int showRect(HWND hwnd,HDC hdc,int show[10][22]){&&& int m,n;&&SelectObject (hdc, GetStockObject (BLACK_BRUSH)) ;&for (m = 0 ; m & 10 ; m++)&&for (n = 0 ; n & 22 ; n++)&&{&&&&&&if (show [m][n])&&&{&&&&&&&&SelectObject (hdc, GetStockObject (WHITE_BRUSH)) ;&&&&Rectangle (hdc, m, n,m + 1, n + 1) ;&&&&SelectObject (hdc, GetStockObject (BLACK_BRUSH)) ;&&&}&&&& &&&else&&&&Rectangle (hdc, m, n,m + 1, n + 1) ;&&}&&return 0 ;} //定义游戏初始化函数int initGame(HWND hwnd,int show[10][22]){&&& int m,&srand((unsigned)time(NULL));&&& i = rand () % 7 ;&next = rand () % 7 ;&score = 0;&level = 0;&start = 1 ;&pause = 0 ;&lost = 0 ;&moment1 = 1 ;&moment2 = 1 ;&j = 0 ;&x = 0 ;&y = 0 ;&for(m=0;m&10;m++)&&for(n=0;n&22;n++)&&&&&&&&&&& show[m][n] = 0 ;&&for(m=0;m&10;m++)&&{&&&mPoint[m].x = BlockPoint[i][j][m].x;&&&mPoint[m].y = BlockPoint[i][j][m].y;&&}&&for(m=0;m&10;m++)&&{&&&nextPoint[m].x = BlockPoint[next][0][m].x + 10 ;&&&nextPoint[m].y = BlockPoint[next][0][m].y + 3 ;&&}&&InvalidateRect (hwnd, NULL, 1) ;&&SetTimer(hwnd,1,500,NULL);&&return 0 ;}//定义图形块消除函数int destroyBlock(HWND hwnd,int show[10][22]){&int m=0,n=0,iCount=0,dBlock=0;//dBlock用于记录每行中图形块的消除标志&int dLine[22] = {0};//定义一个整型数组记录行消除标志&for(n=0;n&22;n++)//取得行消除标志记录在dLine数组&{&& for(m=0;m&10;m++)&&& if(show[m][n])&&& {&&&&& dBlock ++ ;&&&if(dBlock == 10)&&&&& dLine[n] = 1 ;&&& }&& dBlock = 0 ;&}&&//消除方块&for(n=21;n&=0;n--)&{&& iCount =&& if(dLine[iCount])&& {&&&& for(iCiCount&0;iCount--)&&&& for(m=0;m&10;m++)&&&& show[m][iCount] = show[m][iCount-1] ;&&&&&&& for(m=0;m&10;m++)&&&& show[m][iCount] = 0 ;&&iCount =&&for(iCiCount&0;iCount--)&&&dLine[iCount] = dLine[iCount-1] ;&&dLine[iCount] = 0 ;&&&& score += 10 ;&&Sleep(200) ;//延迟200毫秒&&InvalidateRect(hwnd,NULL,0) ;&&n ++ ;&&& }&}&&if(score &= 900)//设置游戏关卡&{&& level = 3 ;&&&&& start = 0 ;&&&&& KillTimer(hwnd,1);&& MessageBox(hwnd,TEXT("恭喜你!你已全部通关,\n")&&& TEXT("成为一名游戏高手!"),TEXT("提示"),0) ;&& for(m=0;m&10;m++)&&for(n=0;n&22;n++)&&&&&&&&&&& show[m][n] = 0 ;&&&&& show[4][1] = 1 ;&& for(m=3;m&6;m++)&&& show[m][2] = 1 ;&& show[4][4] = 1 ;&& for(m=2;m&7;m++)&&& show[m][5] = 1 ;&& for(m=6;m&9;m++)&&& show[2][m] = 1 ;&& for(m=6;m&9;m++)&&& show[6][m] = 1 ;&& show[4][7] = show[6][10] = show[5][10] = show[4][11] = show[3][11] = 1 ;&& for(m=3;m&7;m++)&&& show[m][13] = 1 ;&&&&& for(m=2;m&8;m++)&&& show[m][15] = 1 ;&&&&& for(m=12;m&21;m++)&&& show[5][m] = 1 ;&& show[4][20] = show[3][19] = 1 ;&& InvalidateRect(hwnd,NULL,0) ;&}&else&&if(score &= 600 && moment2)&&{&&level = 2 ;&&grade = 2 ;&&&&&&& SetTimer(hwnd,1,200,NULL);&&&&&&& InvalidateRect(hwnd,NULL,0) ;&&}&&else&&&if(score &= 300 && moment1)&&&{&&&& level = 1 ;&&&& grade = 1 ;&&&&&&&&&&&&& SetTimer(hwnd,1,400,NULL);&&&&&&&&&&&&& InvalidateRect(hwnd,NULL,0) ;&&&}&return 0 ;}//定义文字输出函数int printWord(HDC hdc,TCHAR szFileName[]){&&& int m,cxChar,cyC&TEXTMETRIC&HFONT hF&LOGFONT&GetTextMetrics (hdc, &tm) ; &&& cxChar = tm.tmAveCharW &cyChar = tm.tmHeight + tm.tmExternalL&SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT)) ;&&& m=sprintf(szFileName,TEXT("next :"));&&& TextOut(hdc,11,2,szFileName,m);&&& m=sprintf(szFileName,TEXT("level : %d"),level);&&& TextOut(hdc,11,4,szFileName,m);&&& m=sprintf(szFileName,TEXT("score : %d"),score);&&& TextOut(hdc,11,6,szFileName,m);&if(lost)&{&&SetBkMode (hdc, TRANSPARENT) ;&&SetTextColor(hdc,RGB(42,187,36));&&hFont = EzCreateFont (hdc, TEXT ("Times New Roman"), &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 250, 0, 0, TRUE) ;
&&&&&&& GetObject (hFont, sizeof (LOGFONT), &lf) ;&&&&&&& SelectObject (hdc, hFont) ;&&&&&&& m=sprintf(szFileName,TEXT("Game Over"));&&TextOut(hdc,0,5,szFileName,m);&&&&&&& DeleteObject (SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT))) ;&&SetTextColor(hdc,RGB(0,0,0));&}&&& if(grade == 1)&{&&SetBkMode (hdc, TRANSPARENT) ;&&SetTextColor(hdc,RGB(42,187,36));&&hFont = EzCreateFont (hdc, TEXT ("Times New Roman"), &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 700, 0, 0, TRUE) ;
&&&&&&& GetObject (hFont, sizeof (LOGFONT), &lf) ;&&&&&&& SelectObject (hdc, hFont) ;&&&&&&& m=sprintf(szFileName,TEXT("1"));&&TextOut(hdc,4,5,szFileName,m);&&&&&&& DeleteObject (SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT))) ;&&SetTextColor(hdc,RGB(0,0,0));&&Sleep(1500) ;&&grade = 0 ;&&moment1 = 0 ;&}&if(grade == 2)&{&&SetBkMode (hdc, TRANSPARENT) ;&&SetTextColor(hdc,RGB(42,187,36));&&hFont = EzCreateFont (hdc, TEXT ("Times New Roman"), &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 700, 0, 0, TRUE) ;
&&&&&&& GetObject (hFont, sizeof (LOGFONT), &lf) ;&&&&&&& SelectObject (hdc, hFont) ;&&&&&&& m=sprintf(szFileName,TEXT("2"));&&TextOut(hdc,4,5,szFileName,m);&&&&&&& DeleteObject (SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT))) ;&&SetTextColor(hdc,RGB(0,0,0));&&Sleep(1500) ;&&grade = 0 ;&&moment1 = 0 ;&&moment2 = 0 ;&}&return 0;}
LRESULT CALLBACK ButtonProc (HWND hwnd, UINT message,//窗口控件回调函数&&&&&&& WPARAM wParam, LPARAM lParam){&&& int id = GetWindowLong (hwnd, GWL_ID);//取得窗口ID&&& switch (message)//处理窗口消息&{&case WM_KEYDOWN ://处理键盘消息&&if (wParam == VK_TAB)//处理TAB键&&&&&&//设置窗口焦点 &&&SetFocus (GetDlgItem (GetParent (hwnd),//获取父窗口句柄&&&(id + (GetKeyState (VK_SHIFT) & 0 ? 1 : 1)) % 2)) ;&&//根据SHIFT键是否按下获取不同的ID值&&else&&&SendMessage (GetParent (hwnd), message, wParam, lParam) ;&&&&&&&&& &case WM_SETFOCUS ://处理窗口焦点消息&&idFocus =&&&}&&& return CallWindowProc (OldButton[id], hwnd, message, wParam,lParam) ;//将消息返回给系统}
/*---------------------------------------&& EZFONT.C -- Easy Font Creation&&&&&&&&&&&&&& (c) Charles Petzold, 1998& ---------------------------------------*/
#include &windows.h&#include &math.h&#include "EZFont.h"//定义创建字体函数HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight,&&&&&&&&&&&&&&&&&&& int iDeciPtWidth, int iAttributes, BOOL fLogRes){&&&& FLOAT&&&&& cxDpi, cyD&&&& HFONT&&&&& hF&&&& LOGFONT&&&&&&& POINT&&&&&&&&& TEXTMETRIC&&&& &&&& SaveDC (hdc) ;//保存当前设备&&&& &&&& SetGraphicsMode (hdc, GM_ADVANCED) ;//指明字体映射模式&&&& ModifyWorldTransform (hdc, NULL, MWT_IDENTITY) ;//指明全局座标转换方式&&&& SetViewportOrgEx (hdc, 0, 0, NULL) ;&&&& SetWindowOrgEx&& (hdc, 0, 0, NULL) ;&&&& &&&& if (fLogRes)&&&& {&&&&&&&&& cxDpi = (FLOAT) GetDeviceCaps (hdc, LOGPIXELSX) ;&&&&&&&&& cyDpi = (FLOAT) GetDeviceCaps (hdc, LOGPIXELSY) ;&&&& }&&&& else&&&& {&&&&&&&&& cxDpi = (FLOAT) (25.4 * GetDeviceCaps (hdc, HORZRES) /&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& GetDeviceCaps (hdc, HORZSIZE)) ;&&&&&&&&& &&&&&&&&& cyDpi = (FLOAT) (25.4 * GetDeviceCaps (hdc, VERTRES) /&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& GetDeviceCaps (hdc, VERTSIZE)) ;&&&& }&&&& &&&& pt.x = (int) (iDeciPtWidth& * cxDpi / 72) ;&&&& pt.y = (int) (iDeciPtHeight * cyDpi / 72) ;&&&& &&&& DPtoLP (hdc, &pt, 1) ;&&&& &&&& lf.lfHeight&&&&&&&& = - (int) (fabs (pt.y) / 10.0 + 0.5) ;&&&& lf.lfWidth&&&&&&&&& = 0 ;&&&& lf.lfEscapement&&&& = 0 ;&&&& lf.lfOrientation&&& = 0 ;&&&& lf.lfWeight&&&&&&&& = iAttributes & EZ_ATTR_BOLD&&&&& ? 700 : 0 ;&&&& lf.lfItalic&&&&&&&& = iAttributes & EZ_ATTR_ITALIC&&& ?&& 1 : 0 ;&&&& lf.lfUnderline&&&&& = iAttributes & EZ_ATTR_UNDERLINE ?&& 1 : 0 ;&&&& lf.lfStrikeOut&&&&& = iAttributes & EZ_ATTR_STRIKEOUT ?&& 1 : 0 ;&&&& lf.lfCharSet&&&&&&& = DEFAULT_CHARSET ;&&&& lf.lfOutPrecision&& = 0 ;&&&& lf.lfClipPrecision& = 0 ;&&&& lf.lfQuality&&&&&&& = 0 ;&&&& lf.lfPitchAndFamily = 0 ;&&&& &&&& lstrcpy (lf.lfFaceName, szFaceName) ;&&&& &&&& hFont = CreateFontIndirect (&lf) ;&&&& &&&& if (iDeciPtWidth != 0)&&&& {&&&&&&&&& hFont = (HFONT) SelectObject (hdc, hFont) ;&&&&&&&&& &&&&&&&&& GetTextMetrics (hdc, &tm) ;&&&&&&&&& &&&&&&&&& DeleteObject (SelectObject (hdc, hFont)) ;&&&&&&&&& &&&&&&&&& lf.lfWidth = (int) (tm.tmAveCharWidth *&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& fabs (pt.x) / fabs (pt.y) + 0.5) ;&&&&&&&&& &&&&&&&&& hFont = CreateFontIndirect (&lf) ;&&&& }&&&& &&&& RestoreDC (hdc, -1) ;//恢复原先的设备&&&& return hF}/*----------------------&& EZFONT.H header file& ----------------------*///声明创建字体函数HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight,&&&&&&&&&&&&&&&&&&& int iDeciPtWidth, int iAttributes, BOOL fLogRes) ;
#define EZ_ATTR_BOLD&&&&&&&&& 1#define EZ_ATTR_ITALIC&&&&&&& 2#define EZ_ATTR_UNDERLINE&&&& 4#define EZ_ATTR_STRIKEOUT&&&& 8/*以下代码存为Script1.rc放在工程RussianBlock里面*///Microsoft Developer Studio generated resource script.//#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS///////////////////////////////////////////////////////////////////////////////// Generated from the TEXTINCLUDE 2 resource.//#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////// Chinese (中国) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)#ifdef _WIN32LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED#pragma code_page(936)#endif //_WIN32
///////////////////////////////////////////////////////////////////////////////// Icon//
// Icon with lowest ID value placed first to ensure application icon// remains consistent on all systems.RussianBlock&&&&&&&&&&& ICON&&& DISCARDABLE&&&& "RussianBlock.ico"
#ifdef APSTUDIO_INVOKED///////////////////////////////////////////////////////////////////////////////// TEXTINCLUDE//
1 TEXTINCLUDE DISCARDABLE BEGIN&&& "resource.h\0"END
2 TEXTINCLUDE DISCARDABLE BEGIN&&& "#include ""afxres.h""\r\n"&&& "\0"END
3 TEXTINCLUDE DISCARDABLE BEGIN&&& "\r\n"&&& "\0"END
#endif&&& // APSTUDIO_INVOKED
#endif&&& // Chinese (中国) resources/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED///////////////////////////////////////////////////////////////////////////////// Generated from the TEXTINCLUDE 3 resource.//
/////////////////////////////////////////////////////////////////////////////#endif&&& // not APSTUDIO_INVOKED
/*以下代码存为resource.h放在工程RussianBlock里面*/
//{{NO_DEPENDENCIES}}// Microsoft Developer Studio generated include file.// Used by Script1.rc//#define RussianBlock&&&&&&&&&&&&&&&&&&& 101
// Next default values for new objects// #ifdef APSTUDIO_INVOKED#ifndef APSTUDIO_READONLY_SYMBOLS#define _APS_NEXT_RESOURCE_VALUE&&&&&&& 102#define _APS_NEXT_COMMAND_VALUE&&&&&&&& 40001#define _APS_NEXT_CONTROL_VALUE&&&&&&&& 1000#define _APS_NEXT_SYMED_VALUE&&&&&&&&&& 101#endif#endif
/*再在网上找个ICO图标,命名为RussianBlock.ico,
然后放在工程RussianBlock里,用vc++编译就行了*/
发表评论:
TA的最新馆藏[转]&[转]&[转]&

我要回帖

更多关于 俄罗斯方块下载 的文章

 

随机推荐