REGROUND_INTENSITY};
textout(handle,dx-10,6+dy,wColors,1,"SCORE");
textout(handle,dx-10,12+dy,wColors,1,"LEVEL");
textout(handle,32+dx,8+dy,wColors,1,"NEXT");
wColors[0]=FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY;
drawblocks(&map[0][0],15,25,0,0,wColors,1);
textout(handle,dx,dy,wColors,1,"◎═════════════◎");
wColors[0]=FOREGROUND_BLUE| FOREGROUND_GREEN|FOREGROUND_INTENSITY;
textout(handle,dx+8,dy+5,wColors,1,"按任意键开始");
wColors[0]=FOREGROUND_BLUE|FOREGROUND_RED|FOREGROUND_INTENSITY ;
textout(handle,dx+7,dy-3,wColors,1,"制作者:***");
int x=_getch();
srand(time(NULL));
textout(handle,dx+8,dy+5,wColors,1," ");
}
int * build() //创建方块
{
int * a=NULL;
int c=rand()%7;
switch(c)
{
case 0:
a=&a1[0][0];break;
case 1:
a=&a2[0][0];break;
case 2:
a=&a3[0][0];break;
case 3:
a=&a4[0][0];break;
case 4:
a=&a5[0][0];break;
case 5:
a=&a6[0][0];break;
case 6:
a=&a7[0][0];break;
}
return a;
}
void drawblocks(int a[],int w,int h,int x,int y,WORD wColors[],int nColors) //画出方块
{
HANDLE handle;
handle = initiate();
int temp;
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
if((temp=a[i*w+j])&&y+i>0)
{
if(temp==-3)
{
textout(handle,2*(x+j)+dx,y+i+dy,wColors,nColors,"◎");
_sleep(30);
}
else if(temp==-2)
{
textout(handle,2*(x+j)+dx,y+i+dy,wColors,nColors,"║");
_sleep(30);
}
else if(temp==1)
textout(handle,2*(x+j)+dx,y+i+dy,wColors,nColors,"◎");
else if(temp==-1)
{
textout(handle,2*(x+j)+dx,y+i+dy,wColors,nColors,"═");
_sleep(30);
}
}
}
void delete_cache() //清除缓冲区
{
while(_kbhit())
{
_getch();
}
}
void delete_blocks(int *a,int w,int h,int x,int y) //覆盖方块
{
HANDLE handle;
handle=initiate();
WORD wColors[1]={SQUARE_COLOR};
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
if(a[i*w+j]&&i+y>0)
textout(handle,2*(x+j)+dx,y+i+dy,wColors,1," ");
}
void revolve(int a[][4],int w,int h,int *x,int y) //转动方块
{
int b[4][4]={{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}};
int sign=0,line=0;
for(int i=h-1;i>=0;i--)
{
for(int j=0;j<w;j++)
if(a[i][j])
{
b[j][line]=a[i][j];
sign=1;
}
if(sign)
{
line++;
sign=0;
}
}
for(i=0;i<4;i++)
if(isavailable(&b[0][0],*x-i,y,w,h))
{
*x-=i;
for(int k=0;k<h;k++)
for(int j=0;j<w;j++)
a[k][j]=b[k][j];
break;
}
}
void deletefull_line(int m[][MAPW],int row,int w,int h) //消除满行的方块
{
HANDLE handle;
handle=initiate();
WORD wColors[1]={SQUARE_COLOR};
textout(handle,2+dx,row+dy,wColors,1,"﹌﹌﹌﹌﹌﹌﹌﹌﹌﹌");
_sleep(100);
int i;
for(i=row;i>1;i--)
{
delete_blocks(&m[i][1],MAPW-2,1,1,i);
for(int j=1;j<MAPW-1;j++)
m[i
用VC++mfc实现俄罗斯方块的程序详解_IT/计算机_专业资料 暂无评价0人阅读0次下载举报文档 用VC++mfc实现俄罗斯方块的程序详解_IT/计算机_专业资料。课程设计 ...
c++俄罗斯方块代码讲解_IT/计算机_专业资料。俄罗斯方块俄罗斯方块 jshjdjsdjsd ...()); CView::OnTimer(nIDEvent); } Move(3)是行的,Move(7)对于程序运行...
C语言编写的《俄罗斯方块》详解_IT/计算机_专业资料。用C语言编写俄罗斯方块,... Tc2.0 编写俄罗斯方块游戏 很多编程爱好者都编写过俄罗斯方块的游戏程序。...
俄罗斯方块详解 16页 20财富值喜欢此文档的还喜欢 vb小游戏代码 13页 免费 俄罗斯方块vb代码 5页 1财富值 100个经典C语言程序[免费下... 64页 免费 VB高级...
c语言俄罗斯方块实验报告和代码详解_IT/计算机_专业资料。C 语言之游戏 俄罗斯...二、概要设计该程序中的函数设置总体主要功能大致如下 1.找到合适的方块盒子(7 ...
俄罗斯方块程序超详细解释_IT/计算机_专业资料。俄罗斯方块程序超详细解释...这前面只粗略讲解核心算法: 这里把游戏的关键设计放在三个盒子和一个坐标上: 大...
首页 > 单片机源码 > 详细内容 俄罗斯方块源程序大公开作者:徐文军 发布时间:2008-3-16 阅读次数:2807 字体大小: 【小】 【中】 【大】 //---// // /...
俄罗斯方块c语言详解_IT/计算机_专业资料。俄罗斯方块c语言详解俄罗斯方块最详解...实现的源程序(菜单上好像还有小 bugs,不影响大体) /*Russian_Diamond.c*/ #...
我把我的设计原理尽量讲清: 首先,俄罗斯方块游戏中的基础是 Block(方块) ,而 Block(方块)又是由 Brick(砖块)构成, 所以,我在程序中就设计了这两个类:Class ...
C++俄罗斯方块程序设计详细说明_IT/计算机_专业资料。C++俄罗斯方块程序设计详细... c++俄罗斯方块代码讲解 22页 1下载券 C++俄罗斯方块程序设计 22页 1下载券...
热门文档