debug:僵尸被子弹射中有时候不会死掉。。(前面不用管,因为字数上线,我删了一部分) - 爱问答

(爱问答)

debug:僵尸被子弹射中有时候不会死掉。。(前面不用管,因为字数上线,我删了一部分)


if(c==32){
if(right==1){
for(int Bullets=y+1;Bullets<=20;Bullets++){
a[zombiesX][zombiesY]=0;
if(zombiesY==Bullets&&zombiesX==x){
zombiesX=1;
zombiesY=1;
a[zombiesX][zombiesY]=0;
Integral++;
}
if(zombiesY==y&&zombiesX==x){
system("cls");
cout<<"          GAME OVER        "<<endl;
cout<<"         Integral:"<<Integral<<endl;
cout<<"      thank you to play";
return 0;
}
if(zombiesX!=x&&zombiesX<x){
zombiesX++;
}
else if(zombiesY!=y&&zombiesY<y){
zombiesY++;
}
else if(zombiesX!=x&&zombiesX>x){
zombiesX--;
}
else if(zombiesY!=y&&zombiesY>y){
zombiesY--;
}
a[zombiesX][zombiesY]=4;
int Zx=x,Zy=y,ZB=Bullets;
system("cls");
cout<<"Integral:"<<Integral<<endl;
for(int i=0;i<20;i++){
if(i!=x){
for(int o=0;o<20;o++){
if(o==Bullets&&i==x)
cout<<8<<" ";
else if(o!=Bullets)
cout<<a[i][o]<<" ";
}
cout<<endl;
}
else{
for(int o=0;o<20;o++){
if(o==Bullets+1&&i==x)
cout<<8<<" ";
else if(o!=Bullets)
cout<<a[i][o]<<" ";
}
cout<<endl;
}
}
if(up==1)
cout<<"上";
if(down==1)
cout<<"下";
if(right==1)
cout<<"   子弹方向:右     射速:"<<10000-Rateofire<<"m/秒";
if(left==1)
cout<<"   子弹方向:左     射速:"<<10000-Rateofire<<"m/秒";
cout<<endl<<"按q退出   by Luo Tsun Lam    Jerry";
Sleep(Rateofire);
Rateofire+=100;
}
}
if(left==1){
for(int Bullets=y-1;Bullets>=0;Bullets--){
a[zombiesX][zombiesY]=0;
if(zombiesY==Bullets&&zombiesX==x){
zombiesX=1;
zombiesY=1;
a[zombiesX][zombiesY]=0;
Integral++;
}
if(zombiesY==y&&zombiesX==x){
system("cls");
cout<<"          GAME OVER        "<<endl;
cout<<"         Integral:"<<Integral<<endl;
cout<<"      thank you to play";
return 0;
}
if(zombiesX!=x&&zombiesX<x){
zombiesX++;
}
else if(zombiesY!=y&&zombiesY<y){
zombiesY++;
}
else if(zombiesX!=x&&zombiesX>x){
zombiesX--;
}
else if(zombiesY!=y&&zombiesY>y){
zombiesY--;
}
a[zombiesX][zombiesY]=4;
int Zx=x,Zy=y,ZB=Bullets;
system("cls");
cout<<"Integral:"<<Integral<<endl;
for(int i=0;i<20;i++){
if(i!=x){
for(int o=0;o<20;o++){
if(o==Bullets&&i==x)
cout<<8<<" ";
else if(o!=Bullets)
cout<<a[i][o]<<" ";
 
}
cout<<endl;
}
else{
for(int o=0;o<20;o++){
if(o==Bullets-1&&i==x)
cout<<8<<" ";
else if(o!=Bullets)
cout<<a[i][o]<<" ";
 
}
cout<<endl;
}
}
if(up==1)
cout<<"上";
if(down==1)
cout<<"下";
if(right==1)
cout<<"   子弹方向:右     射速:"<<10000-Rateofire<<"m/秒";
if(left==1)
cout<<"   子弹方向:左     射速:"<<10000-Rateofire<<"m/秒";
cout<<endl<<"按q退出   by Luo Tsun Lam    Jerry";
Sleep(Rateofire);
Rateofire+=100;
}
}
system("cls");
cout<<"Integral:"<<Integral<<endl;
for(int i=0;i<20;i++){
for(int o=0;o<20;o++){
cout<<a[i][o]<<" ";
}
cout<<endl;
}
if(up==1)
cout<<"上";
if(down==1)
cout<<"下";
else if(right==1)
cout<<"   子弹方向:右     射速:"<<10000-Rateofire<<"m/秒";
else if(left==1)
cout<<"   子弹方向:左     射速:"<<10000-Rateofire<<"m/秒";
cout<<endl<<"按q退出   by Luo Tsun Lam    Jerry";
}
Rateofire=0;
    }
}

这是植物大决战僵尸代码,是子弹和僵尸触碰死亡逻辑代码,最好不要乱删游戏自带文档和代码,

相关标签:僵尸

下一篇:xp系统用记事本打开txt,不显示文字,为什么?

上一篇:xgen是什么文件夹

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?