xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

這是一個用 C 語言設計的連連看小游戲,這個資源里面不僅有程序源代碼,而且還有詳細的 PPT 說明文檔,對于剛開始接觸游戲設計的編程愛好者來說,可以提供一定的幫助。 這個程序只是一個構思的框架,界面不是特別華麗,但是對于需要理解編程思路的人來說,一樣是一個不錯的起點。

資源截圖

代碼片段和文件信息

//?MatchIt.cpp?:?小游戲《連連看》基本框架
//
//?版本:0.3
//
//?制作:馬森陽
//
//?制作時間:2013.2.16?-?2013.3.5
//
//?詳細內容請參閱程序目錄下的?PPT?說明。
//
//?http://hi.baidu.com/masenyang

#include?“stdafx.h“


/*定義標題欄*/
#define?title?“連連看?V0.3,C?語言版“

/*定義真假宏*/
#define?FALSE?0
#define?TRUE?1

/*定義行列數*/
#define?ROW?8
#define?COL?10

/*定義圖案種類數*/
#define?TOTAL?20

/*定義無效標識*/
#define?NONE?0

/*定義特殊按鍵*/
#define?BAK?0x08
#define?ENT?0x0d
#define?ESC?0x1b
#define?SPC?0x20

/*聲明程序中的類*/
class?Matchit;??????????????????????//連連看類,設計游戲基本操作框架
class?LangPack;?????????????????????//語言包類,用于游戲中的信息提示

/*定義?連連看?類*/
class?Matchit{

protected:

int?pic[TOTAL];?????????????????//圖案集合
int?stack[ROW*COL];?????????????//卡堆
int?board[ROW+2][COL+2];????????//游戲板

int?cursor_Rcursor_C;??????????//光標位(行、列)
int?select_Rselect_C;??????????//選定位(行、列)

int?cur_Level;??????????????????//當前級別(EASY?NORMAL?HARD)
int?cur_Stage;??????????????????//當前關卡(0~10)

int?rem_Card;???????????????????//剩余卡片數
int?rem_Time;???????????????????//剩余時間量
int?rem_Hint;???????????????????//剩余提示數
int?rem_Life;???????????????????//剩余生命值

char?hint_Msg[64];??????????????//游戲過程中的提示信息

public:

/*類的構造方法*/
Matchit(){
int?ij;
for(i=0;i pic[i]=i+1;
}
for(i=0;i stack[i]=NONE;
}
for(j=0;j for(i=0;i board[j][i]=NONE;
}
}
cur_Level=0;
cur_Stage=0;
rem_Card=rem_Time=rem_Hint=rem_Life=0;
cursor_R=cursor_C=NONE;
select_R=select_C=NONE;
strcpy(hint_Msg““);
}

/*游戲之前的待命狀態*/
int?standby(){
char?k;
int?f=FALSE;
system(“cls“);
puts(title);
putchar(‘\n‘);
puts(“請選擇游戲級別:(測試版只提供初級)“);
puts(“[??1??]?初級“);
puts(“[?ESC?]?退出游戲“);
printf(“選擇:“);
do{
k=getch();
switch(k){
case?‘1‘:
cur_Level=1;
cur_Stage=0;
rem_Life=5;
rem_Hint=10;
starter();
f=TRUE;
break;
case?ESC:
f=FALSE;
break;
}
}while(k!=‘1‘?&&?k!=ESC);
return?f;
}

/*游戲開始前的準備工作*/
void?starter(){
int?ijkcf;
int?n=ROW*COL;
srand(unsigned(time(0)));
for(i=0;i stack[i]=pic[i%TOTAL];
}
for(j=1;j<=ROW;j++){
for(i=1;i<=COL;i++){
c=rand()%n;
board[j][i]=stack[c];
n--;
for(k=c;k stack[k]=stack[k+1];
}
}
}
rem_Card=ROW*COL;
f=is_Legal();
if(!f)?discard();
cursor_R=cursor_C=1;
select_R=select_C=0;
strcpy(hint_Msg“游戲開始,請按屏幕下方的提示進行操作?!埃?
}

/*游戲進行中*/
int?playing(){
int?f=FALSE;
display();
do{
if(rem_Card==0){
f=ending_Next();
break;
}
else?if(!is_Legal()?&&?rem_Life==0){
f=ending_Dead();
break;
}
else?if(!is_Legal()?&&?rem_Life>0){
discard();
rem_Life--;
strcpy(hint_Msg“【注意】牌局出現無解畫面,自動扣除一點生命值進行洗牌。“);
display();
}
f=key_Press();
}while(f);
return?f;
}

/*游戲過程中讀取按鍵內容進行相應操作,通過返回值決定是否退出程序*/
int?key_Press(){
cha

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-03-08?21:38??Matchit\
?????目錄???????????0??2013-03-08?21:38??Matchit\Debug\
?????文件??????184414??2013-03-08?21:38??Matchit\Debug\Matchit.exe
?????文件??????304396??2013-03-08?21:38??Matchit\Debug\Matchit.ilk
?????文件???????37278??2013-03-08?21:38??Matchit\Debug\Matchit.obj
?????文件??????227632??2013-02-28?17:40??Matchit\Debug\Matchit.pch
?????文件??????517120??2013-03-08?21:38??Matchit\Debug\Matchit.pdb
?????文件????????2331??2013-02-28?17:40??Matchit\Debug\StdAfx.obj
?????文件???????41984??2013-03-08?21:38??Matchit\Debug\vc60.idb
?????文件???????61440??2013-03-08?21:38??Matchit\Debug\vc60.pdb
?????文件???????14786??2013-03-08?21:38??Matchit\Matchit.cpp
?????文件????????4548??2013-02-28?17:38??Matchit\Matchit.dsp
?????文件?????????539??2013-02-28?17:38??Matchit\Matchit.dsw
?????文件???????50176??2013-03-08?21:38??Matchit\Matchit.ncb
?????文件???????53760??2013-03-08?21:38??Matchit\Matchit.opt
?????文件????????1330??2013-03-08?21:38??Matchit\Matchit.plg
?????文件????????1214??2013-02-28?17:38??Matchit\ReadMe.txt
?????文件?????????294??2013-02-28?17:38??Matchit\StdAfx.cpp
?????文件?????????768??2013-02-28?17:40??Matchit\StdAfx.h
?????文件??????364544??2013-03-08?21:36??Matchit\《連連看》說明.ppt

評論

共有 條評論