火星降落3.1

· · 个人记录

火星降落3.0的新版本。。。

没啥太大区别de~

优化了一下场景,很小的差别~(具体哪里我不说了)

玩法:

1.降落 空格键开关火 左右移动

2.火星任务 tab打开左舱门 insert打开右舱门 back火星车(左) delet火星车(右)

(和3.0一样)

上代码:

#include<bits/stdc++.h>
#include <iostream>
#include <windows.h>
#include <cstdio>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int h=20,zy=0,h2=100,yin=1,cang=0,z=0,y=0,che=0,rw=0,mima,cang2=0,y2=0,rw2=0,che2=0;
double fuel=100;
void zuo();
void hh();
void hhh();
void zuo1();
void you1();
void you2();
int main(){
    while(h>0){
        _sleep(10);
        system("CLS");
        cout<<"high:"<<h<<endl;
        cout<<"fuel:"<<fuel<<endl;
        hhh();
        zuo();
        cout<<"/-\\ "<<endl;
        hh();
        cout<<"*--------------/-\\-____-_____/-\\--------------/-\\-__________/-\\*"<<endl;
        if(yin>=1){
            h2-=5;
            yin=2; 
            fuel-=0.5;
        }
        else{
            yin--;
            if(yin<-10) h2-=15;
            else h2-=10;
        }
        if(h2<=0){
            h--;
            h2=100;
        }
        if(KEY_DOWN(VK_LEFT)){
            zy--;
        }
        if(KEY_DOWN(VK_RIGHT)){
            zy++;
        }
        if(KEY_DOWN(VK_SPACE)&&fuel>=1.0){
            if(yin<=0) yin=1;
            else yin=0;
        }
        if(fuel<=0) yin=0;
        z=zy-5;
    }
    if(yin==2&&((zy>=19&&zy<=28&&zy!=24)||(zy>=50&&zy<=58))){
        system("CLS");
        hhh();
        zuo();
        cout<<"/-\\ "<<endl;
        cout<<"*--------------/-\\-____-_____/-\\--------------/-\\-__________/-\\*"<<endl;
        cout<<"good!"<<endl;
    }
    else{
        system("CLS");
        hhh();
        zuo();
        cout<<"/-\\ "<<endl;
        cout<<"*--------------/-\\-____-_____/-\\--------------/-\\-__________/-\\*"<<endl;
        cout<<"a-ou!"<<endl;
        return 0;
    }
    _sleep(1000);
    while(1){
        system("CLS");
        hhh();
        zuo1();

        if(che==1){
            cout<<"o@o";
        }
        else{
            cout<<"   ";
        }
        you1();
        cout<<"/-\\ ";
        you2();
        if(che2==1){
            cout<<"o@o"<<endl;
        }
        else{
            cout<<endl;
        } 
        if(rw==0){
            cout<<"*";
        }
        else{
            cout<<"-";
        }
        cout<<"--------------/-\\-____-_____/-\\--------------/-\\-__________/-\\-";
        if(rw2==0){
            cout<<"*"<<endl;
        }
        else{
            cout<<"-"<<endl;
        }
        if(KEY_DOWN(VK_TAB)){
            cang=!cang;
        }
        if(KEY_DOWN(VK_BACK)&&y<=1&&cang==1&&che2==0){
            che=!che;
        }
        if(KEY_DOWN(VK_LEFT)&&((che==1&&z>=1)||(che2==1&&y2>=1))){
            if(che==1){
                y++;
                z--;
            }
            else y2--;
        }
        if(KEY_DOWN(VK_RIGHT)&&((che==1&&y>=1)||che2==1)){
            if(che==1){
                y--;
                z++;
            }
            else y2++;
        }
        if(rw==1&&che==0&&cang==0&&rw2==1&&che2==0&&cang2==0){
            break;
        }
        if(z==0&&che==1){
            rw=1;   
        }
        if(z+6+y+y2==60&&che2==1){
            rw2=1;
        }
        if(KEY_DOWN(VK_INSERT)){
            cang2=!cang2;
        }
        if(KEY_DOWN(VK_DELETE)&&che==0&&y2==0&&cang2==1){
            che2=!che2;
        }
    }
    system("CLS");
    hhh();
    zuo();
    cout<<"/-\\ "<<endl;
    cout<<"---------------/-\\-____-_____/-\\--------------/-\\-__________/-\\-"<<endl;
    cout<<"OK!"<<endl;
    _sleep(2000); 

    return 0;
}
void hh(){
    if(yin>=1){
        zuo();
        cout<<"\\|/"<<endl;
    } 
    else{
        cout<<endl;
    }
    for(int i=2;i<h;i++){
        cout<<endl;
    }
}
void zuo(){
    for(int i=1;i<=zy;i++){
        cout<<" ";
    }
}
void hhh(){
    for(int i=1;i<22-h;i++){
        cout<<endl;
    }
}
void zuo1(){
    for(int i=1;i<=z;i++){
        cout<<" ";
    }
}
void you1(){
    for(int i=0;i<=y;i++){
        cout<<" ";
    }
    if(cang==1){
        cout<<"_";
    }
    else{
        cout<<" ";
    }
}
void you2(){
    if(cang2==1){
        cout<<"_";
    }
    else{
        cout<<" ";
    }
    for(int i=2;i<=y2;i++){
        cout<<" ";
    }
}

2022-7-22:

竟然还能有人注意到我的第七篇文章,太感动了

我猜你们都是因为粉福来的!

快去找线索吧。

您是第位来访者。