?先点赞!
本次更新优化了数据,本体并未发生改变。
上代码!
#include<iostream>
#include<iomanip>
#include<conio.h>
#include<windows.h>
#include<cstdlib>
#include<ctime>
#include<stdlib.h>
using namespace std;
short q,w,e,r,t,a,s,d;long long p;string str;bool tru=true;
string *gamemode=new string("live");bool LWR=false;
const short map_x=21,map_y=71; //地图大小
char map[(map_x)][(map_y)]; //地图
short map_xue[(map_x)][(map_y)]; //地图血量
struct djnb
{short sh;string name;short sc;short zd;};
djnb djbn[100]=
{
{ 0 , " ",0 , 0},
{100, " 拳头 ",1 , 0},
{100, " 手枪 ",5 , 10},
{100, " RPG ",10, 1 },
{100, " 方块 ",1 , 0 },
{100, " 激光枪 ",40, 10},
{100, " AK47 ",30, 40},
{100, "牛马手雷", 5, 1 },
{0 , " ",0, 0 },
{0 , " ",0, 0 },
{0 , " ",0, 0 },
{0 , " ",0, 0 },
};
struct PLAYer
{
string name;
short X,x,Y,y;short fx;
short ys;short box;
short bjd[10][2];
short dj;short djq;short shs;
string pf;short pfn;
};
PLAYer PLAYER =
{
"大帅哥",
10,10,2,2,1,
1,1,
{},
1,1,0,
" O+#",2
};
class game//地图
{
public:
static void pd(); //判断
static void shuchu();//输出
static void chushi();//初始化
static void make_map(); //自定义
static void qx(); //群系
};
void mp(short x,short y,char z) {map[x][y]=z;if(z!=' '){map_xue[x][y]=100;}}
class QT
{
public:
static void tz(short a);//拓展
static void kg(short a);//拓展的空格
static void gb(bool sdf);//游戏基础
static void gbyd(int x, int y); // 提供xy值来移动光标
static void jc();
};
class mx
{
public:
static void AR();//出现
static void DR();//消失
};
class player
{
public:
static void dj_shiyong();
static void panduan();//判断
static void yidong(short a);//移动
static void sz_shezhi();//设置
static void sz_pifu();static void sz_gm();
static void zl_shuru();
static void zl_zhiling(string a);//指令
static void zl_jsb(short a);//记事本
static void zl_spawn(short a,short b,short c);//传送
};
int main()
{
game::make_map();
game::chushi();
while(1)
{
QT::gb(false);
player::panduan();
game::shuchu();
}
}
///地/
///图
void game::pd()
{
if(map_xue[PLAYER.x][PLAYER.y]==0){PLAYER.X=PLAYER.x;PLAYER.Y=PLAYER.y;}
for(q=0;q<=map_x-1;q++)
{
for(w=0;w<=map_y-1;w++)
{
if(map_xue[q][w]<0)//负数归零(生命为负数)
{map_xue[q][w]=0;}
if(map_xue[q][w]==0)//空气(生命为0)
{map[q][w]=' ';}
}
}
}
void game::shuchu()//输出
{
game::pd();
system("color 00");//隐藏
mx::AR();
for(q=0;q<map_x;q++)
{
QT::tz(1);
for(w=0;w<map_y;w++)
{
cout<<map[q][w];
}
QT::tz(2);cout<<endl;
}
system("color 07");//显示(完整)
Sleep(20);//等待(否则无法看清下方部分)
system("CLS");//清屏(到下一帧)
mx::DR();
}
void game::chushi()//初始
{
SetConsoleTitle("命运0.3.5");
for(q=0;q<=map_y-1;q++){mp(0,q,'#');mp(map_x-1,q,'#');}
for(q=0;q<=map_x-1;q++){mp(q,0,'#');mp(q,map_y-1,'#');}
for(q=1;q<=map_x-1;q++){mp(q,w,'#');}
for(q=2;q<=map_x-2;q++){for(w=2;w<=map_y-2;w++){map_xue[q][w]=0;}}
game::make_map();
}
void game::make_map()//自定义地形
{
if(*gamemode=="game")
{
for(q=1;q<=3;q++){mp(7,q,'#');mp(13,q,'#');}for(q=7;q<=9;q++){mp(7,q,'#');mp(13,q,'#');}
for(q=3;q<=7;q++){mp(3,q,'#');mp(4,q,'#');mp(16,q,'#');
mp(17,q,'#');}mp(8,9,'#');mp(12,9,'#');
for(q=13;q<=17;q++){mp(9,q,'#');mp(10,q,'#');mp(11,q,'#');}
for(q=1;q<=3;q++){mp(0+q,22,'#');mp(4+q,22,'#');mp(0+q,35,'#');mp(4+q,35,'#');}
for(q=22,w=31;q<=26,w<=35;q++,w++){mp(7,q,'#');mp(7,w,'#');}
for(q=61;q<=63;q++){mp(7,q,'#');mp(13,q,'#');}
for(q=67;q<=69;q++){mp(7,q,'#');mp(13,q,'#');}
for(q=63;q<=67;q++){mp(3,q,'#');mp(4,q,'#');
mp(16,q,'#');mp(17,q,'#');}mp(8,61,'#');mp(12,61,'#');
for(q=53;q<=57;q++){mp(9,q,'#');mp(10,q,'#');mp(11,q,'#');}
for(q=0;q<2;q++){mp(16,25+q,'#');mp(16,29+q,'#');mp(17,25+q,'#');mp(17,29+q,'#');}
for(q=0;q<10;q++){mp(18,12+q,'#');}
mp(18,34,'#');mp(18,35,'#');mp(18,39,'#');mp(18,39,'#');
mp(18,40,'#');mp(18,41,'#');mp(16,39,'#');mp(17,39,'#');
for(q=14;q<=17;q++){mp(q,21,'#');mp(q,34,'#');}
for(q=22;q<=33;q++){mp(14,q,'#');}
}
if(*gamemode=="live"){game::qx();}
}
void game::qx()
{
srand(time(0));
q=rand()%51;
for(w=0;w<q;w++)
{
e=rand()%21;r=rand()%71;
t=rand()%5;
switch(t)
{
case 1:
mp(e,r,'#');
break;
case 2:
mp(e-1,r,' ');mp(e-1,r,'|');mp(e-1,r+1,' '); //
mp(e,r-1,'-');mp(e,r,'+'); mp(e,r+1,'-'); //
mp(e+1,r,' ');mp(e+1,r,'|');mp(e+1,r+1,' '); //
break;
case 3:
t=rand()%3;
switch(t)
{
case 1:mp(e-1,r,'|');mp(e,r,'|');mp(e+1,r,'|');break;
case 2:mp(e,r-1,'-');mp(e,r,'-');mp(e,r+1,'-');break;
}
break;
case 4:
mp(e-1,r-1,'#');mp(e-1,r,'#');mp(e-1,r+1,'#');
mp(e,r-1,'#'); mp(e,r+1,'#');
mp(e+1,r-1,'#');mp(e+1,r,'#');mp(e+1,r+1,'#');
break;
}
}
}
void QT::tz(short a)//拓展
{
if(a==1&&LWR)
{
if(q==0){cout<<"###############";}
if(q==1){
cout<<"当前坐标:"<<PLAYER.X<<" "<<PLAYER.Y;
//有空位要补齐
e=0;
if(PLAYER.X>=10){e++;}if(PLAYER.Y>=10){e++;}
w=2;w-=e;for(e=1;e<=w;e++){cout<<" ";}
}
if(q==2){cout<<"# ";}
if(q==3){cout<<"#名称:大帅哥 ";}
if(q==4){cout<<"#ID:31415926535";}
if(q==5){cout<<"###############";}
if(q==6){cout<<"# "<<djbn[PLAYER.dj-1].name<<" ";}
if(q==7){cout<<"#->"<<djbn[ PLAYER.dj ].name<<"当前";}
if(q==8){cout<<"# "<<djbn[PLAYER.dj+1].name<<" ";}
if(q==9){cout<<"###############";}
for(w=10;w<map_x-1;w++){if(q==w){cout<<"# ";}}
if(q==map_x-1){cout<<"###############";}
}
if(a==2&&LWR)
{
if(q==0){cout<<"####################";}
if(q==1){cout<<"当前武器:"<<djbn[PLAYER.dj].name<<" #";}
if(q==2){cout<<"武器类型:"<<djbn[PLAYER.dj].name<<" #";}
if(q==3){cout<<"武器伤害: ";e=djbn[PLAYER.dj].sh;QT::kg(e);cout<<"#";}
if(q==4){cout<<"当前射程: ";w=djbn[PLAYER.dj].sc;QT::kg(w);cout<<"#";}
if(q==5){cout<<"当前移速: ";QT::kg(PLAYER.ys);cout<<"#";}
if(q==6){cout<<"当前血量: ";e=map_xue[PLAYER.X][PLAYER.Y];QT::kg(e);cout<<"#";}
if(q==7){cout<<" ( 按下V键关闭 ) #";}
if(q==8){cout<<"####################";}
for(w=9;w<map_x-1;w++){if(q==w){cout<<" #";}}
if(q==map_x-1){cout<<"####################";}
}
}
void QT::kg(short a)//空格
{cout<<a;
if(a>=0&&a<10){cout<<setw(7);}if(a>=10&&a<100){cout<<setw(6);}if(a>=100){cout<<setw(5);}
}
void QT::gb(bool sdf)
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);CONSOLE_CURSOR_INFO CursorInfo;
GetConsoleCursorInfo(handle, &CursorInfo);//获取控制台光标信息
if(sdf==false){CursorInfo.bVisible = false;}//隐藏控制台光标
if(sdf==true){CursorInfo.bVisible = true;}//显示控制台光标
SetConsoleCursorInfo(handle, &CursorInfo);//设置控制台光标状态
}
void QT::gbyd(int x,int y)
{COORD coord; coord.X = x; coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);}
void QT::jc(){system("CLS");cout<<"湿布永远的神";Sleep(1000);system("CLS");}
//键///
//盘///
void player::panduan()
{
if(_kbhit())
{
char *kd=new char;
*kd=getch();
switch(*kd)
{
case 'W':case 'w':
case 'S':case 's':
case 'A':case 'a':
case 'D':case 'd':
player::yidong(*kd);
break;//移动
case 13:
if(*gamemode!="live"){player::dj_shiyong();}
break;//使用道具
case 'Z':case 'z':
player::zl_jsb(1);
break;//记事本
case 'V':case 'v':LWR=!LWR;break;//任务栏
case '/':player::zl_shuru();break;//指令
case 27:player::sz_shezhi();break;//设置
}
if(*kd>=49&&*kd<=57){q=*kd-=48;PLAYER.djq=PLAYER.dj;
PLAYER.dj=q;short shs;shs=djbn[PLAYER.dj].sh;}//切换道具
if(*kd==81){q=PLAYER.dj;PLAYER.dj=PLAYER.djq;PLAYER.djq=q;}//Q道具上下换
delete kd;
}
}
void player::yidong(short a)
{
switch(a)
{
case 'W':case 'w':
w=PLAYER.x;w-=PLAYER.ys;PLAYER.fx=1;
for(e=PLAYER.x-1;e>=w;e--)
{PLAYER.x=e;if(map_xue[e][PLAYER.y]!=0){PLAYER.x=e+1;break;}}
break;
case 'S':case 's':
w=PLAYER.x;w+=PLAYER.ys;PLAYER.fx=2;
for(e=PLAYER.x+1;e<=w;e++)
{PLAYER.x=e;if(map_xue[e][PLAYER.y]!=0){PLAYER.x=e-1;break;}}
break;
case 'A':case 'a':
w=PLAYER.y;w-=PLAYER.ys;PLAYER.fx=3;
for(e=PLAYER.y-1;e>=w;e--)
{PLAYER.y=e;if(map_xue[PLAYER.x][e]!=0){PLAYER.y=e+1;break;}}
break;
case 'D':case 'd':
w=PLAYER.y;w+=PLAYER.ys;PLAYER.fx=4;
for(e=PLAYER.y+1;e<=w;e++)
{PLAYER.y=e;if(map_xue[PLAYER.x][e]!=0){PLAYER.y=e-1;break;}}
break;
}
if(map[PLAYER.x][PLAYER.y]=='#'){PLAYER.x=PLAYER.X;PLAYER.y=PLAYER.Y;}//有障碍
if(map[PLAYER.x][PLAYER.y]!='#'){PLAYER.X=PLAYER.x;PLAYER.Y=PLAYER.y;}//无障碍
}
///模///
///型//
void mx::AR()
{
map[PLAYER.X][PLAYER.Y]=PLAYER.pf[PLAYER.pfn];
}
void mx::DR()
{
map[PLAYER.X][PLAYER.Y]=' ';
}
///道//
///具/
void jx(short a,short b,short c)//减血(方便)
{
PLAYER.shs=djbn[PLAYER.dj].sh;
if(c==1)//单减血
{
map_xue[a][b]-=PLAYER.shs;
}
if(c==2)
{
jx(a-1,b-1,1);jx(a-1,b,1);jx(a-1,b+1,1);
jx(a,b-1,1);jx(a,b,1);jx(a,b+1,1);
jx(a+1,b-1,1);jx(a+1,b,1);jx(a+1,b+1,1);
}
if(c==3)
{
map_xue[a][b]+=PLAYER.shs;
}
if(c==4)
{
if(b==1){ for(q=1;q<=djbn[PLAYER.dj].sc;q++)
{if(PLAYER.X-q>=0){jx(PLAYER.X-q,PLAYER.Y,1); }}}
if(b==2){ for(q=1;q<=djbn[PLAYER.dj].sc;q++)
{if(PLAYER.X+q<map_x){jx(PLAYER.X+q,PLAYER.Y,1);}}}
if(b==3){ for(q=1;q<=djbn[PLAYER.dj].sc;q++)
{if(PLAYER.Y-q>=0){jx(PLAYER.X,PLAYER.Y-q,1); }}}
if(b==4){ for(q=1;q<=djbn[PLAYER.dj].sc;q++)
{if(PLAYER.Y+q<map_y){jx(PLAYER.X,PLAYER.Y+q,1);}}}
}
}
void player::dj_shiyong()//远程道具判断
{
e=djbn[PLAYER.dj].sc;
a=PLAYER.dj;
switch(PLAYER.fx)
{
case 1:
for(w=1;w<=e;w++)
{//变化距离
if(map_xue[q-w][PLAYER.Y]!=0)//减血
{
if(a==1||a==2){jx(PLAYER.X-w,PLAYER.Y,1);}
if(a==3){jx(PLAYER.X-w,PLAYER.Y,2);}
if(a==6){jx(PLAYER.X-w,PLAYER.Y,1);}
break;
}else{//加血
if(a==4)
{r=(PLAYER.box-1)/2;t=PLAYER.x-w; for(q=PLAYER.y-r;q<=PLAYER.y+r;q++){jx(t,q,3);}}
}
}
if(a==5){jx(1,1,4);}//固定距离
if(a==7){jx(PLAYER.X-djbn[a].sc,PLAYER.Y,2);}
case 2:
for(w=1;w<=e;w++)
{
if(map_xue[q+w][PLAYER.Y]!=0)//减血
{
if(a==1||a==2){jx(PLAYER.X+w,PLAYER.Y,1);}
if(a==3){jx(PLAYER.X+w,PLAYER.Y,2);}
if(a==6){jx(PLAYER.X+w,PLAYER.Y,1);}
break;
}else{//加血
if(a==4){r=(PLAYER.box-1)/2;t=PLAYER.X+w;
for(q=PLAYER.Y-r;q<=PLAYER.Y+r;q++){jx(t,q,3);}}
}
}
if(a==5){jx(1,2,4);}
if(a==7){jx(PLAYER.X+djbn[a].sc,PLAYER.Y,2);}
case 3:
for(w=1;w<=e;w++)
{
if(map_xue[PLAYER.X][PLAYER.Y-w]!=0)//减血
{
if(a==1||a==2){jx(PLAYER.X,PLAYER.Y-w,1);}
if(a==3){jx(PLAYER.X,PLAYER.Y-w,2);}
if(a==6){jx(PLAYER.X,PLAYER.Y-w,1);}
break;
}else{//加血
if(a==4){r=(PLAYER.box-1)/2;t=PLAYER.Y-w;
for(q=PLAYER.X-r;q<=PLAYER.X+r;q++){jx(q,t,3);}}
}
}
if(a==5){jx(1,3,4);}
if(a==7){jx(PLAYER.X,PLAYER.Y-djbn[a].sc,2);}
case 4:
for(w=1;w<=e;w++)
{
if(map_xue[PLAYER.X][PLAYER.Y+w]!=0)//加血
{
if(a==1||a==2){jx(PLAYER.X,PLAYER.Y+w,1);}
if(a==3){jx(PLAYER.X,PLAYER.Y+w,2);}
if(a==6){jx(PLAYER.X,PLAYER.Y+w,1);}
break;
}else{//减血
if(a==4){r=(PLAYER.box-1)/2;t=PLAYER.Y+w;
for(q=PLAYER.X-r;q<=PLAYER.X+r;q++){jx(q,t,3);}}
}
}
if(a==5){jx(1,4,4);}
if(a==7){jx(PLAYER.X,PLAYER.Y+djbn[a].sc,2);}
}
}
void player::zl_shuru()
{
system("CLS");
for(q=1;q<=5;q++){cout<<endl;}
cout<<" ——————————————————————"<<endl;
cout<<" |'help'for help|/ |"<<endl;
cout<<" |------------------------------------------|"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" |------------------------------------------|"<<endl;
cout<<" | |"<<endl;
cout<<" |—————————————————————|"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" | |"<<endl;
cout<<" ——————————————————————"<<endl;
QT::gbyd(39,6);//移动光标位置
QT::gb(true);//显示光标
getline(cin,str);
player::zl_zhiling(str);
}
void player::zl_zhiling(string a)//指令
{
//****帮助****//
if(a=="HELP"||a=="help")
{QT::gb(false);player::zl_jsb(1);}
//****坐标类****//
if(a=="TP"||a=="tp"){QT::gbyd(42,6);cin>>e>>r;PLAYER.x=e;PLAYER.y=r; }//更改坐标
if(a=="SPAWN"||a=="spawn"){PLAYER.x=10;PLAYER.y=2;}//回到最初出生点
if(a=="SPAWNPOINT"||a=="spawnpoint")//设置坐标
{ QT::gbyd(23,8); cout<<"1."<<PLAYER.bjd[1][0]<<" "<<PLAYER.bjd[1][1];
QT::gbyd(23,9); cout<<"2."<<PLAYER.bjd[2][0]<<" "<<PLAYER.bjd[2][1];
QT::gbyd(23,10);cout<<"3."<<PLAYER.bjd[3][0]<<" "<<PLAYER.bjd[3][1];
QT::gbyd(23,11);cout<<"4."<<PLAYER.bjd[4][0]<<" "<<PLAYER.bjd[4][1];
QT::gbyd(23,16);cout<<"请选择:";e=getch();e-=48;
if(e>=1&&e<10){q=PLAYER.X;r=PLAYER.Y; player::zl_spawn(q,r,e);}
}
if(a=="TP SPAWN"||a=="tp spawn")//前往标记点
{
QT::gbyd(23,8); cout<<"1."<<PLAYER.bjd[1][0]<<" "<<PLAYER.bjd[1][1];
QT::gbyd(23,9); cout<<"2."<<PLAYER.bjd[2][0]<<" "<<PLAYER.bjd[2][1];
QT::gbyd(23,10);cout<<"3."<<PLAYER.bjd[3][0]<<" "<<PLAYER.bjd[3][1];
QT::gbyd(23,11);cout<<"4."<<PLAYER.bjd[4][0]<<" "<<PLAYER.bjd[4][1];
QT::gbyd(23,16);cout<<"请选择:";
e=getch();e-=48;
if(e>=1&&e<=4){PLAYER.x=PLAYER.bjd[e][0];PLAYER.y=PLAYER.bjd[e][1];}
}
//****清除****/
if(a=="CLEAR"||a=="clear"){game::chushi();}
//****填充****//
if(a=="FILL"||a=="fill")
{
PLAYER.X=2;PLAYER.x=2;PLAYER.Y=2;PLAYER.y=2;
game::chushi();
PLAYER.bjd[1][0]=2;PLAYER.bjd[1][1]=2;
PLAYER.bjd[2][0]=2;PLAYER.bjd[2][1]=map_y-3;
PLAYER.bjd[3][0]=map_x-3;PLAYER.bjd[3][1]=2;
PLAYER.bjd[4][0]=map_x-3;PLAYER.bjd[4][1]=map_y-3;
}
if(a=="GAMEMODE"||a=="gamemode")
{
QT::gbyd(23,8); cout<<"1.home";
QT::gbyd(23,9); cout<<"2.game";
QT::gbyd(23,10);cout<<"3.live";
QT::gbyd(23,16);cout<<"请选择:";
e=getch();e-=48;
switch(e)
{
case 1:
*gamemode="home";PLAYER.X=10;PLAYER.x=10;PLAYER.Y=2;PLAYER.y=2;
break;
case 2:
*gamemode="game";PLAYER.X=10;PLAYER.x=10;PLAYER.Y=2;PLAYER.y=2;
break;
case 3:
*gamemode="live";
break;
}
game::make_map();
}
//****buff****//
if(a=="BUFF"||a=="buff")
{
QT::gbyd(23,8);cout<<"1.fast";
QT::gbyd(23,9);cout<<"1.slow";
QT::gbyd(23,16);cout<<"请选择:";
e=getch();e-=48;
QT::gbyd(23,16);cout<<"请输入:";cin>>q;
if(e==1){PLAYER.ys+=q;}
if(e==2){PLAYER.ys-=q;}
}
//****更改****//
if(a=="CHANGE"||a=="change")
{
QT::gbyd(45,6);cout<<" the";
QT::gbyd(23,8);cout<<"1.the speed to:";
QT::gbyd(23,9);cout<<"2.the box to:";
QT::gbyd(23,10);cout<<"3.damage:";
QT::gbyd(23,16);cout<<"请选择:";
e=getch();e-=48;
QT::gbyd(23,16);cout<<"请输入:";cin>>q;
if(e==1){PLAYER.ys=q;}
if(e==2){if(q%2==1) {PLAYER.box=q;}}
if(e==3){cin>>djbn[PLAYER.dj].sh;}
}
if(a=="OPEN"||a=="open")
{
QT::gbyd(23,8);cout<<"1.track:";
QT::gbyd(23,9);cout<<"2.:";
QT::gbyd(23,10);cout<<"3.:";
QT::gbyd(23,16);cout<<"请选择:";
e=getch();e-=48;
if(e==1)
{
QT::gbyd(23,8); for(q=1;q<=42;q++){cout<<" ";}QT::gbyd(23,8); cout<<"1.box";
QT::gbyd(23,9); for(q=1;q<=42;q++){cout<<" ";}QT::gbyd(23,9); cout<<"2.";
QT::gbyd(23,10);for(q=1;q<=42;q++){cout<<" ";}QT::gbyd(23,10);cout<<"3.";
QT::gbyd(23,11);for(q=1;q<=42;q++){cout<<" ";}QT::gbyd(23,11);cout<<"4.";
QT::gbyd(23,16);cout<<"请选择:";
q=getch();q-=48;
}
}
system("CLS");QT::gb(false);//隐藏光标
}
void player::zl_jsb(short a)//日记
{
while(1)
{
system("CLS");
if(a==1)
{
cout<<"##################################"<<endl;
cout<<"# 指令使用大全 #"<<endl;
cout<<"#1./tp (位移)#"<<endl;
cout<<"#(1)/tp x,y (任意位移)#"<<endl;
cout<<"#(2)spawn (默认游戏标记点)#"<<endl;
cout<<"#(3)/spawnpoint (设置标记点)#"<<endl;
cout<<"#(4)/tp spawn (传送至标记点)#"<<endl;
cout<<"#2./clear (清除)#"<<endl;
cout<<"#3./fill (填充)#"<<endl;
cout<<"#4./buff: #"<<endl;
cout<<"#(1):fast: (移动速度加快)#"<<endl;
cout<<"#(2):slow: (移动速度减慢)#"<<endl;
cout<<"#5./change (更改)#"<<endl;
cout<<"#(1):the speed to (更改速度)#"<<endl;
cout<<"#(2):the box to (更改箱子)#"<<endl;
cout<<"#(3):damage (更改伤害)#"<<endl;
cout<<"#5./open (打开)#"<<endl;
cout<<"#(1):track (追踪)#"<<endl;
cout<<"# (1)box (箱子)#"<<endl;
cout<<"#←←← →→→#"<<endl;
cout<<"#上一页 退出 下一页#"<<endl;
cout<<"#( A ) (空格) ( D )#"<<endl;
cout<<"##################################"<<endl;
}
if(a==2)
{
cout<<"###################################"<<endl;
cout<<"#csdn湿布原创 #"<<endl;
cout<<"#https://blog.csdn.net/m0_54672684#"<<endl;
cout<<"#本文是作者独立完成,请勿盗码 #"<<endl;
cout<<"###################################"<<endl;
}
e=getch();
if(e==65){a--;}if(e==68){a++;}
if(e==32){break;}
}system("CLS");
}
void player::zl_spawn(short a,short b,short c)
{
PLAYER.bjd[0][0]=2;PLAYER.bjd[0][1]=2;
PLAYER.bjd[c][0]=a;PLAYER.bjd[c][1]=b;
}
void player::sz_shezhi()
{
system("CLS");
cout<<"########################"<<endl;
cout<<"#1.皮肤设置 #"<<endl;
cout<<"#2.游戏模式 #"<<endl;
cout<<"# #"<<endl;
cout<<"# #"<<endl;
cout<<"# #"<<endl;
cout<<"########################"<<endl;
while(1)
{
char *kd=new char;
*kd=getch();
*kd-=48;
if(*kd>0&&*kd<10)
{
switch(*kd)
{
case 1:player::sz_pifu();break;
case 2:player::sz_gm();break;
}
break;
}
}
}
void player::sz_pifu()
{
tru=true;
short *pfd=new short(PLAYER.pfn);
while(tru)
{
system("CLS");
cout<<*pfd<<endl;
cout<<"##########################################"<<endl;
cout<<"#选择皮肤:—————— #"<<endl;
cout<<"# | | #"<<endl;
cout<<"# | | #"<<endl;
cout<<"# | | #"<<endl;
cout<<"# —————— #"<<endl;
cout<<"# ";
if(*pfd==0){cout<<"| 你的皮肤| #"<<endl;}
else{ cout<<"| 官方皮肤| #"<<endl;}
cout<<"# —————— #"<<endl;
cout<<"# 确定(W) 自定义(S) #"<<endl;
cout<<"#<--上一个(A) 退出(空格) (D)下一个-->#"<<endl;
cout<<"##########################################"<<endl;
QT::gbyd(16,4);cout<<PLAYER.pf[*pfd];
e=getch();
switch(e)
{
case 65:*pfd-=1;break;//A上一个
case 68:*pfd+=1;break;//D下一个
case 32:tru=false;break;//空格退出
case 87:PLAYER.pfn=*pfd;tru=false;break;//W确定
case 83:QT::gbyd(16,4);cout<<" ";
cin>>PLAYER.pf[0];PLAYER.pfn=0;*pfd=0;break;//S自定义
}
system("CLS");
}
delete pfd;
}
void player::sz_gm()
{
tru=true;
system("CLS");
cout<<"#########################"<<endl;
cout<<"#选择模式: #"<<endl;
cout<<"#1.home #"<<endl;
cout<<"#2.game #"<<endl;
cout<<"#3.live #"<<endl;
cout<<"# #"<<endl;
cout<<"#########################"<<endl;
while(tru)
{
e=getch();e-=48;
switch(e)
{
case 1:*gamemode="home";tru=false;break;
case 2:*gamemode="game";tru=false;break;
case 3:*gamemode="live";tru=false;break;
}
game::make_map();
system("CLS");
}
}
作者是一名萌新,有更好的意见请提出(评论),记得三连支持一下吧!
|