91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

用VC6.0寫的一款在控制臺里玩的掃雷游戲

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
using?namespace?std;

//?宏定義
#define?KEY_UP????0xE048?????????????//↑鍵
#define?KEY_DOWN??0xE050?????????????//↓鍵
#define?KEY_LEFT??0xE04B?????????????//←鍵
#define?KEY_RIGHT?0xE04D?????????????//→鍵
#define?KEY_ESC???0x001B?????????????//ECS鍵
#define?KEY_1?????‘1‘????????????????//字符1
#define?KEY_2?????‘2‘????????????????//字符2
#define?KEY_3?????‘3‘????????????????//字符3
#define?KEY_4?????‘4‘????????????????//字符4
#define?GAME_MAX_WIDTH???50?????????//最大寬度?x
#define?GAME_MAX_HEIGHT??50?????????//最大高度?y

//宏定義顏色
#define?LIGHTBLUE??????9?//????1????藍色
#define?LAKEBLUE???????3?//????2????湖藍色
#define?LIGHTGREEN?????11?//????3????黃色
#define?PURPLE?????????5?//????4????紫色
#define?LIGHTPURPLE????13?//?5678?淡紫色
#define?WHITE??????????7?//???方塊??白色
#define?GREEN??????????2?//???標記??綠色
#define?LIGHTRED???????12?//???雷區??淡紅色
#define?YELLOW?????????6?//??誤掃????黃色

//?字符串宏定義,用于游戲結束后的不同使用
#define?STR_GAMEtitle?“\t游戲指南:1?=?使勁.踩;2?=?我.掃...;3?=?AOE群**?;ESC?=?返回主菜單“
#define?STR_GAMEWIN???“\t祝賀你!掃雷成功!\n“
#define?STR_GAMEOVER??“\t踩到地雷!對不起你輸了!\n“
#define?STR_GAMEEND???“\n\t\t感謝使用~!歡迎下次再來O(∩_∩)O~~\n“

static?int?BoomNum;
static?int?NowBoomNum;
//-------------------------------------------------------------
//?控制臺類---指示光標等控制臺操作
class?CConsoleWnd
{
????public:
????????static?int?TextOut(const?char*);?????????????//輸出字符串
????????static?int?GotoXY(int?int);?????????????????//光標指向(x,y)
????????static?int?CharOut(int?int?const?int);?????//輸出位于(x,y)上的字符
????????static?int?TextOut(int?int?const?char*);???//輸出位于(x,y)上的字符串
????????static?int?GetKey();?????????????????????????//獲取鍵入的ASCII碼
};
//
//??int?CConsoleWnd::GetKey()
//??等待標準輸入,返回鍵碼
//
int?CConsoleWnd::GetKey()
{
int?nkey=getch()nk=0;
if(nkey>=128||nkey==0)nk=getch();
return?nk>0?nkey*256+nk:nkey;
}
//
//??int?CConsoleWnd::GotoXY(int?x?int?y)
//??將控制臺光標移至(x,y)點
//
int?CConsoleWnd::GotoXY(int?x?int?y)
{
COORD?cd;
cd.X?=?x;cd.Y?=?y;
return?SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE)cd);
}
//
//??int?CConsoleWnd::TextOut(const?char*?pstr)
//??在當前位置輸出字符串
//
int?CConsoleWnd::TextOut(const?char*?pstr)
{
for(;*pstr;++pstr)putchar(*pstr);
return?0;
}
//
//??int?CConsoleWnd::CharOut(int?x?int?y?const?int?pstr)
//??輸出在(x,y)上的字符
//
int?CConsoleWnd::CharOut(int?x?int?y?const?int?pstr)
{
GotoXY(x?y);
return?putchar(pstr);
}
//
//??int?CConsoleWnd::TextOut(const?char*?pstr)
//??輸出在(x,y)上的字符串
//
int?CConsoleWnd::TextOut(int?x?int?y?const?char*?pstr)
{
GotoXY(x?y);
return?TextOut(pstr);
}
//
//-------------------------------------------------------------
//應用類---正式玩游戲??控制臺類的派生類
class?CSLGame:public?CConsoleWnd
{
private:
private:
int?curXcurY;?????????//當前x,y
int?poolWidthpoolHeight;?????//當前寬度和高度
int?bm_gamepool[GAME_MAX_HEIGHT+2][GAME_MAX_WIDTH+2];????//游戲存放字符的二維數組
public:
CSLGame():curX(

評論

共有 條評論