• 周五. 4 月 24th, 2026

物嫩软件资讯网

软件资讯来物嫩

射击游戏c++

admin@wunen

5 月 12, 2025
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <stdlib.h> 
#include <dsound.h>
using namespace std;
int main(void){
    int zombiesY=1,zombiesX=1;
    int c,a[20][20]={0},x=9,y=9,Integral=0,Bullets,right=0,left=0,up=0,down=0,start=0,Rateofire=0,ZX,ZY,ZB;
    a[9][9]=1;
    for(int i=0;i<10;i++){
        cout<<"* ";
    }
    cout<<"回车键开始";
    for(int i=0;i<10;i++){
        cout<<"* ";
    }
    c=getch();
    if(c==13){
        for(int p=0;p<20;p++){
            system("cls");
            start++;
            for(int i=0;i<start;i++){
                cout<<"  ";
            }
            for(int i=0;i<20-start;i++){
                cout<<"* ";
            }
            cout<<endl<<"                     加载中";
            Sleep(250);
        }
        system("cls");
        cout<<"            射击游戏"<<endl;
        cout<<"Integral:"<<Integral<<endl;
        for(int i=0;i<20;i++){
            for(int o=0;o<20;o++){
                cout<<a[i][o]<<" ";
            }
            cout<<endl;
        }
        cout<<"按q退出   by Luo Tsun Lam    Jerry"<<endl<<"地图:20*20.上下左右操作,空格打子弹,僵尸是4,子弹是8,你是1,地面是0,开枪吸引僵尸,僵尸被子弹射中有时候不会死掉,右上角分数.";
        while(1){
            int Zx=x,Zy=y,ZB=Bullets;
            c = getch();
            if(c==0) c=getch();
            if( c == 72 ) {
                system("cls");
                
                
                a[x][y]=0;
                x--;
                if(x==-1)
                    x=19;
                a[x][y]=1;
                cout<<"Integral:"<<Integral<<endl;
                int Zx=x,Zy=y,ZB=Bullets;
                for(int i=0;i<20;i++){
                    for(int o=0;o<20;o++){
                        cout<<a[i][o]<<" ";
                    }
                    cout<<endl;
                }
                up=1;
                down=0;
                cout<<"上";
                cout<<endl<<"按q退出   by Luo Tsun Lam    Jerry";
            }
            if ( c == 80){
                system("cls");
                a[x][y]=0;
                x++;
                if(x

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注