跳到正文

个人记录

火星降落3.0

Zilljy258约 7 分钟
原文
文章信息与版本

文章信息

发布
2021年10月4日
收录
2025年12月12日
更新
2026年11月11日
篇幅
约 7 分钟
获赞
1

版本

  1. v1当前

火星降落3.0来了!

新增了降落以后的任务阶段!

玩法:

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

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

上代码:

C++
#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(){
//	cin>>mima;
//	if(mima!=200272){
//		cout<<mima*mima;
//		return 0;
//	}
	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==63&&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<<" ";
	}
}
原文