#include "colorConsole.h"
HANDLE initiate()
{
HANDLE hOutput;
hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
return hOutput;
}
BOOL textout(HANDLE hOutput,int x,int y,WORD wColors[],int nColors,LPTSTR lpszString)
{
DWORD cWritten;
BOOL fSuccess;
COORD coord;
coord.X = x; // start at first cell
coord.Y = y; // of first row
fSuccess = WriteConsoleOutputCharacter(
hOutput, // screen buffer handle
lpszString, // pointer to source string
lstrlen(lpszString), // length of string
coord, // first cell to write to
&cWritten); // actual number written
if (! fSuccess)
cout<<"error:WriteConsoleOutputCharacter"<<endl;
for (;fSuccess && coord.X < lstrlen(lpszString)+x; coord.X += nColors)
{
fSuccess = WriteConsoleOutputAttribute(
hOutput, // screen buffer handle
wColors, // pointer to source string
nColors, // length of string
coord, // first cell to write to
&cWritten); // actual number written
}
if (! fSuccess)
cout<<"error:WriteConsoleOutputAttribute"<<endl;
return 0;
}
(2)第二个cpp
#include <conio.h>
#include <stdlib.h>
#include<stdio.h>
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib") //播放背景音乐的头文件
#include "colorConsole.h"
#include<time.h>
#define SQUARE_COLOR BACKGROUD_BLUE|BACKGROUD_RED| BACKGROUD_INTENSITY //背景颜色
#define SQUARE_COLOR FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_INTENSITY //方块的颜色
#define up 72
#define down 80
#define left 75
#define right 77
#define esc 27
#define MAPW 15 //地图的宽度
#define MAPH 25 //地图的高度
void initiate1();
int * build(); //创建方块 //初始化工作
BOOL isavailable(int a[],int x,int y,int w,int h); //判定是否能放下
void drawblocks(int a[],int w,int h,int x,int y,WORD wColors[],int nColors);
void delete_cache(); //清除键盘缓冲区
void revolve(int a[][4],int w,int h,int *x,int y); //转动方块
void pro();
void end();
void delete_blocks(int *a,int w,int h,int x,int y);
void gameover();
void deletefull_line(int m[][MAPW],int row,int w,int h); //消除一行
int dx=30,dy=5; //屏幕上的偏移量
int score=0,level=0;
int map[MAPH][MAPW];
int a1[4][4]={{1},{1,1,1}};
int a2[4][4]={{0,1},{1,1,1}};
int a3[4][4]={{1,1},{0,1,1}};
int a4[4][4]={{0,0,1},{1,1,1}};
int a5[4][4]={{0,1,1},{1,1}};
int a6[4][4]={{1,1,1,1}};
int a7[4][4]={{1,1},{1,1}};
int a[4][4];
int main()
{
HANDLE handle;
handle=initiate();
WORD wColors[1]={FOREGROUND_BLUE| FOREGROUND_GREEN|FOREGROUND_INTENSI
用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下载券...
热门文档