飞机大战-第1,2,3关

#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
using namespace std;
int z[100][2];bool zc[100];int px,py,sm,df,l=0;char c;
void color(int a);void gotoxy(int x,int y);void full_screen();void start();void csh();void drawmap();void drawplayer();void clsplayer();void _cin();void move();void drawz();void clsz();void change(int k);void print_s_d();void swa(int k);
int poss1_x=12,poss1_y=5;int way=0,poss1sm=200;int p1z[50][2];bool p1zc[50];
void printposs1();void clsposs1();void moveposs1z();void changeposs1z();void drawp1z();void clsp1z();void po1_p();void p_po1();void prints(int posssm);void poss1();
int poss2_x=10,poss2_y=5,poss2sm=400;int p2z[100][2];bool p2zc[100];
void printposs2();void clsposs2();void moveposs2z();void changep2(int k);void drawp2z();void clsp2z();void poss2();void po2_p();void p_po2();
int poss3_x=10,poss3_y=5,poss3sm=1000;int p3z[100][2],sorty[100],sortx[100];bool p3zc[100];
void quick_sort(int l,int r);void printposs3();void clsposs3();void moveposs3z();void changep3(int k);void drawp3z();void clsp3z();void p3move();void po3_p();void p_po3();void poss3();
int main(){full_screen();csh();start();color(7);drawmap();color(11);drawplayer();print_s_d();while(true){_cin();clsz();move();drawz();_sleep(50);l++;if(l%20==0){df++;print_s_d();}if(l==100){poss1();clsp1z();clsposs1();gotoxy(9,58);printf("            ");clsz();color(11);drawplayer();if(sm<=0){color(12);gotoxy(23,21);printf("游  戏  结  束");_sleep(3000);system("cls");return 0;}df+=20;clsplayer();csh();color(11);drawplayer();swa(1);color(7);drawmap();color(11);drawplayer();print_s_d();l=100;}if(l==200){poss2();clsp2z();clsposs2();gotoxy(9,58);printf("            ");clsz();color(11);drawplayer();if(sm<=0){color(12);gotoxy(23,21);printf("游  戏  结  束");_sleep(3000);system("cls");return 0;}df+=50;clsplayer();csh();color(11);drawplayer();swa(2);color(7);drawmap();color(11);drawplayer();print_s_d();l=200;}if(l==300){sm+=df;df=0;poss3();clsp3z();clsposs3();gotoxy(9,58);printf("            ");clsz();color(11);drawplayer();if(sm<=0){color(12);gotoxy(23,21);printf("游  戏  结  束");_sleep(3000);system("cls");return 0;}system("cls");color(14);printf("WIN!\n");break;}}system("pause");return 0;}
void color(int a){SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);return;}
void gotoxy(int i,int j){COORD position={j,i};SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),position);return;}
void full_screen(){HWND hwnd=GetForegroundWindow();int cx=GetSystemMetrics(SM_CXSCREEN);int cy=GetSystemMetrics(SM_CYSCREEN);LONG l_WinStyle=GetWindowLong(hwnd,GWL_STYLE);SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle|WS_MAXIMIZE|WS_POPUP)&~WS_CAPTION&~WS_THICKFRAME&~WS_BORDER); SetWindowPos(hwnd,HWND_TOP,0,0,cx,cy,0);return;}
void start(){color(9);gotoxy(3,36);printf("飞");_sleep(250);color(12);gotoxy(3,38);printf("机");_sleep(250);color(11);gotoxy(3,40);printf("大");_sleep(250);color(14);gotoxy(3,42);printf("战");_sleep(250);color(7);gotoxy(5,34);printf("游戏加载中…");color(10);for(int i=0;i<20;i++){for(int j=0;j<6;j++){gotoxy(7,20+i*2);switch(j){case 0:printf(&

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值