1.增强对手性能
2.可暂停(按N)
3.修复些许bug
4.增加boos关(第10、20、30...关)
本游戏是一个基于Windows控制台的回合制战斗游戏,采用俯视视角的2D平面设计。玩家控制角色"p"在13×25大小的封闭场景中与敌人"@"战斗,通过WASD移动,空格键发射炮弹,Enter键释放震爆弹技能。
游戏采用关卡递增设计,每关BOSS血量会提升10%,具有简单的成长系统。主要游戏元素包括:
玩家角色(p)
敌人(@)
炮弹(*)
场景边界(=)
空白区域(空格)
操作说明运行代码时会显示
#include
#include
#define KEY_DOWN(vKey) ((GetAsyncKeyState(vKey) & 0x8000) ? 1:0)
#define KEY_UP(vKey) ((GetAsyncKeyState(vKey) & 0x8000) ? 0:1)
#include
#include
#include
#include
#include
using namespace std;
int n,m,f=1,k=1;
char wutai[13][25] = {
{'=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','='},
{'=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','=','='}
};
int x=2,y=2,l=0,boos=100,cd=0;;
int ff,xx,yy,g=0,xxx=10,yyy=20,hp1=100,hp2=100;
int q=0;
void print() {
//*
cout<<"操作说明:"<=0; j--) {
cout<<".";
}
cout<=1) {//w
x-=1;
f=1;
}
if (KEY_DOWN(65)&&y-1>=1) {//a
y-=1;
f=3;
}
if (KEY_DOWN(83)&&x+1<11) {//s
x+=1;
f=4;
}
if (KEY_DOWN(68)&&y+1<22) {//d
f=2;
y+=1;
}
if (KEY_DOWN(32)&&g!=1&&k%10!=0) {//空格
g=1;
ff=f;
xx=x;
yy=y;
}
if (KEY_DOWN(13)&&cd==0) {//空格
q=50;
cd=500;
for(int i=0; i<13; i++) {
for(int j=0; j<25; j++) {
cout<<"█";
}
cout<=1) {
xx-=1;
} else if(ff==2&&yy+1<22) {
yy+=1;
} else if(ff==3&&yy-1>=1) {
yy-=1;
} else if(ff==4&&xx+1<11) {
xx+=1;
} else {
g=0;
}
}
if(q==0) {
if(boos<150) {
if(xxxx&&l%3==0) {
xxx+=1;
} else if(y>yyy&&l%3==0) {
yyy+=1;
}
} else if(boos<200){
if(xxxx&&l%2==0) {
xxx+=1;
} else if(y>yyy&&l%2==0) {
yyy+=1;
}
}else{
if(xxxx) {
xxx+=1;
} else if(y>yyy) {
yyy+=1;
}
}
}
if(q>0) {
q--;
}
if(cd>0) {
cd--;
}
if(xx==xxx &&yy==yyy) {
hp2-=5;
g=0;
}
if(xxx==x&&y==yyy)hp1-=0.5;
if(xxx==x&&y==yyy&&k%10==0)hp1-=3;
if(hp1<=0) {
system("cls");
cout<<"you die"<