c++MSG小游戏

大家好,本人老蒟蒻了,最近编了一个游戏,类似于SCP,不过有点菜,请各位大大谅解.

#include<bits/stdc++.h>
#include<Windows.h>
#include<conio.h>
#pragma GCC optimize(2)
using namespace std;
clock_t start,end;
char z;
void jiazai()
{
	system("color f0");
	Sleep(2000);
	for(int i=1; i<=8; i++)
	{
		cout<<endl<<endl<<endl<<endl<<"			                   保命,也是一种技术                          "<<endl;
								cout<<"                                             ----鲁迅                   "<<endl;
								cout<<"                                                                              loading.     "<<i+11*i<<"%";
								Sleep(500);
								system("cls");
		cout<<endl<<endl<<endl<<endl<<"			                   保命,也是一种技术                          "<<endl;
								cout<<"                                             ----鲁迅                   "<<endl;
								cout<<"                                                                              loading. .   "<<i+11*i<<"%";
								Sleep(500);
								system("cls");
		cout<<endl<<endl<<endl<<endl<<"			                   保命,也是一种技术                          "<<endl;
								cout<<"                                             ----鲁迅                   "<<endl;
								cout<<"                                                                              loading. . . "<<i+11*i<<"%";
								Sleep(1000);
								system("cls");
	}
	system("color 0f");
}
void semo();
int main()
{
	cout<<endl<<endl<<endl<<endl<<"			地球上,有很多怪异的现象,怪物,宝物。而我们,就是寻找他们的人"<<endl;
	cout<<"                                                    	                                     ----鲁迅";
	Sleep(5000);
	system("cls");
	Sleep(100);
	cout<<endl<<endl<<endl<<endl<<"                                             chen字工作室";
	 Sleep(5000);
	system("cls");
	Sleep(100);
	cout<<endl<<endl<<endl<<endl<<"                                              M    S    G";
	 Sleep(5000);
	system("cls");
	Sleep(100);
	cout<<endl<<endl<<endl<<endl<<"                                    欢迎你,MSG的探员MSGTQ10290";
	cout<<endl<<endl<<endl<<endl;
							cout<<"                                      *************************            "<<endl;
							cout<<"                                     *                         *            "<<endl;
							cout<<"                                    *     M       S       G     *            "<<endl;
							cout<<"                                    *****************************            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *          o  *  o          *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *             *             *            "<<endl;
							cout<<"                                    *****************************            "<<endl;
							cout<<"                                    *****************************            "<<endl;
							cout<<"                                                                             "<<endl;
							cout<<"                                          输入任意数即可游玩                 "<<endl;
							z=getch();
	system("cls");
	Sleep(100);
	cout<<endl<<endl<<endl<<endl<<"                                    欢迎你,MSG的探员MSGTQ10290";
	cout<<endl<<endl<<endl<<endl;
							cout<<"                                      *************************            "<<endl;
							cout<<"                                     *                         *            "<<endl;
							cout<<"                                    *     M       S       G     *                          "<<endl;
							cout<<"                      *********************************************************"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *      M      *                           *       M     *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *      S      *                           *       S     *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *      G      *                           *       G     *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *             *                           *             *"<<endl;
							cout<<"                      *********************************************************"<<endl;
							cout<<"                      *********************************************************"<<endl;
							cout<<"                                                                             "<<endl;
							Sleep(5000);
							system("cls");
							jiazai();
							semo();
							return 0;
 }
 void semo()
 {
 	int h=1,k=1;
 	char a[1001][1001];
 	memset(a,' ',sizeof(a));
 	srand(time(0));
 	for(int j=2; j<=30; j+=2)
 	{
 		int x;
 		x=1+rand()%9;
 		for(int i=1; i<=x; i++) a[i][j]='8';
 		for(int i=x+3; i<=13; i++) a[i][j]='8';
	 }
 	cout<<endl<<endl<<endl<<endl<<"                                          救命 !!!!!";
							Sleep(2000);
							system("cls");
	cout<<endl<<endl<<endl<<endl<<"                                          救命 !!!!!";	
							Sleep(2000);
							system("cls");
							jiazai();
							bool f=1;
							bool win=0;
							cout<<endl<<endl<<endl<<endl<<"                                          点击s,开始逃命";
							Sleep(2000);
							system("cls");
								while(win==0)
								{
									char b;
									while(win==0)
									{
										b=getch();
										cout<<endl<<endl<<endl<<endl;
										if(b=='w') h--;
										else if(b=='s') h++;
										else if(b=='a') k--;
										else if(b=='d') k++;
										system("cls");
										for(int i=1; i<=13; i++)
										{
											cout<<"            ";
											for(int j=1; j<=30; j++)
											{
												if(i==h&&j==k) cout<<char(3)<<" ";
												else cout<<a[i][j]<<" ";
											}
											cout<<endl;
										}
										if(a[h][k]=='8')
										{
											f=0;
											cout<<"你死了";
											Sleep(5000);
											break;
										}
										if(k==30) break;
									}		
									if(f==0||k!=30)
									{
										f=1;
										k--;
										system("cls");
									}
									else
									{
										cout<<"你赢了";
											Sleep(5000);
										win=1;
									 }
								}
								system("cls");	
								jiazai();
								cout<<endl<<endl<<endl<<endl<<"                                          你不要过来呀!!!";
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"                                                刺!!!    ";
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl;
						        cout<<"                                                   )\\       _" <<endl;
   								cout<<"                                            .--._  ,\' `\\_.-~~/\'"<<endl;
   								cout<<"                                            `\\    \\\'_    __ ( _ _ "<<endl;
   								cout<<"                                             `\\   (_)  |__|/~ ~~=~\\"<<endl;
   								cout<<"                                                )_____.---~~ \\>\\~-./\'"<<endl;
   								cout<<"                                               /\'    //===  /==( "<<endl;
   								cout<<"                                              (     /\' __\\ ( __\\) "<<endl;
   								cout<<"                                              ( /~\\(   o   |_o_( "<<endl;
   								cout<<"                                              (( (         _____)"<<endl;
   								cout<<"                                               \\\\_/     ,      )"<<endl;
   								cout<<"                                                \\ `\\   ~-.._  /"<<endl;
   								cout<<"                                               ._)/ \\        /"<<endl;
   								cout<<"                                                `/   \\     ./"<<endl;
   								cout<<"                                                /     `~/~\'"<<endl;
   								cout<<"                                              \'~~-.__./"<<endl;
   								Sleep(4000);
								system("cls");
								cout<<endl<<endl<<endl<<endl;
						        cout<<"                                                   )\\       _" <<endl;
   								cout<<"                                            .--._  ,\' `\\_.-~~/\'"<<endl;
   								cout<<"                                            `\\    \\\'_    __ ( _ _ "<<endl;
   								cout<<"                                             `\\   (_)  |__|/~ ~~=~\\"<<endl;
   								cout<<"                                                )_____.---~~ \\>\\~-./\'"<<endl;
   								cout<<"                                               /\'    //===  /==( "<<endl;
   								cout<<"                                              (     /\' __\\ ( __\\) "<<endl;
   								cout<<"                                              ( /~\\(   o   |_o_( "<<endl;
   								cout<<"                                              (( (         _____)"<<endl;
   								cout<<"                                               \\\\_/     ,      )"<<endl;
   								cout<<"                                                \\ `\\   ~-.._  /"<<endl;
   								cout<<"                                               ._)/ \\        /"<<endl;
   								cout<<"                                                `/   \\     ./"<<endl;
   								cout<<"                                                /     `~/~\'"<<endl;
   								cout<<"                                           ********************"<<endl;
   								cout<<"                                              \'~~-.__./"<<endl;
   								Sleep(4000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"                                                       M           ";
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"                                                     N  N           ";
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"                                          你的生命-12986 (12986/0)           ";
								Sleep(2000);
								system("cls");
								jiazai();
								system("cls");
								Sleep(2000);
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	/~~~/\\"<<endl;
														cout<<" 	  	  	  	       | c-○○"<<endl;
														cout<<" 	  	  	  	       	 \\|  -|"<<endl;
														cout<<" 	  	  	  	          | |~"<<endl<<endl;
								Sleep(100);
								cout<<" 	  	  	  	 ";
								for(int i=1; i<=22; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"部 "; break;
										case 2: cout<<"长 "; break;
										case 3: cout<<", "; break;
										case 4: cout<<"昨 "; break;
										case 5: cout<<"有 "; break;
										case 6: cout<<"人 "; break;
										case 7: cout<<"被 "; break;
										case 8: cout<<"M  "; break;
										case 9: cout<<"S  "; break;
										case 10: cout<<"G  "; break;
										case 11: cout<<"袭 "; break;
										case 12: cout<<"击 "; break;
										case 13: cout<<"而 "; break;
										case 14: cout<<"死 "; break;
										case 15: cout<<"了 "; break;
										case 16: cout<<", "; break;
										case 17: cout<<"0  "; break;
										case 18: cout<<"0  "; break;
										case 19: cout<<"1  "; break;
										case 20: cout<<"出 "; break;
										case 21: cout<<"逃 "; break;
										case 22: cout<<"了!"; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  		   	  ___"<<endl;
       													cout<<" 	  	  	  	  	 	●●\\\\"<<endl;
       													cout<<" 	  	  	  	  	  	\\\\\\\""<<endl;
       													cout<<" 	  	  	  	  	  	  @ @ c  "<<endl;
       													cout<<" 	  	  	  	  	  	  \\~ /"<<endl<<endl;
       							Sleep(100);
       							cout<<" 	  	  	  	 ";
								for(int i=1; i<=22; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"啊 "; break;
										case 2: cout<<"这 "; break;
										case 3: cout<<", "; break;
										case 4: cout<<"真 "; break;
										case 5: cout<<"麻 "; break;
										case 6: cout<<"烦 "; break;
										case 7: cout<<"被 "; break;
										case 8: cout<<", "; break;
										case 9: cout<<"你 "; break;
										case 10: cout<<"叫 "; break;
										case 11: cout<<"S  "; break;
										case 12: cout<<"级 "; break;
										case 13: cout<<"人 "; break;
										case 14: cout<<"员 "; break;
										case 15: cout<<"去 "; break;
										case 16: cout<<"吧 "; break;
										case 17: cout<<"。 "; break;
										case 18: cout<<"应 "; break;
										case 19: cout<<"该 "; break;
										case 20: cout<<"抓 "; break;
										case 21: cout<<"的 "; break;
										case 22: cout<<"回!"; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	  	  ___"<<endl;
       													cout<<" 	  	  	  	  	  	●●\\\\"<<endl;
       													cout<<" 	  	  	  	  	  	\\\\\\\""<<endl;
       													cout<<" 	  	  	  	  	  	  o o c  "<<endl;
       													cout<<"  	  	  	  	  	 	  \\~ /"<<endl<<endl;
       							Sleep(100);
       							cout<<" 	  	  	  	 ";
								for(int i=1; i<=8; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"不 "; break;
										case 2: cout<<"过 "; break;
										case 3: cout<<", "; break;
										case 4: cout<<"要 "; break;
										case 5: cout<<"快 "; break;
										case 6: cout<<"一 "; break;
										case 7: cout<<"点 "; break;
										case 8: cout<<"! "; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	/~~~/\\"<<endl;
														cout<<" 	  	  	  	       | c-○○"<<endl;
														cout<<" 	  	  	  	       	 \\|  -|"<<endl;
														cout<<" 	  	  	  	          | |~"<<endl<<endl;
								Sleep(100);
								cout<<" 	  	  	  	 ";
								for(int i=1; i<=3; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"好 "; break;
										case 2: cout<<"的 "; break;
										case 3: cout<<"! "; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"MSG高级人员办公室";
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	/~~~/\\"<<endl;
														cout<<" 	  	  	  	       | c-○○"<<endl;
														cout<<" 	  	  	  	       	 \\|  -|"<<endl;
														cout<<" 	  	  	  	          | |~"<<endl<<endl;
								Sleep(100);
								cout<<" 	  	  	  	 ";
								for(int i=1; i<=19; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"L  "; break;
										case 2: cout<<"部 "; break;
										case 3: cout<<"长 "; break;
										case 4: cout<<", "; break;
										case 5: cout<<"有 "; break;
										case 6: cout<<"C  "; break;
										case 7: cout<<"部 "; break;
										case 8: cout<<"长 "; break;
										case 9: cout<<"给 "; break;
										case 10: cout<<"你 "; break;
										case 11: cout<<"的 "; break;
										case 12: cout<<"任 "; break;
										case 13: cout<<"务 "; break;
										case 14: cout<<": "; break;
										case 15: cout<<"抓 "; break;
										case 16: cout<<"捕 "; break;
										case 17: cout<<"0  "; break;
										case 18: cout<<"0  "; break;
										case 19: cout<<"1!"; break;
									}               
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	  	 ______"<<endl;
       													cout<<"		 	  	  		|  ___/ "<<endl;
       													cout<<" 	  	  	  	  	  	| c●● "<<endl;
       													cout<<" 	  	  	  	  	  	 |  -|  "<<endl;
       													cout<<"  	  	  	  	  	 	 | |~   "<<endl<<endl;
       							Sleep(100);
       							cout<<" 	  	  	  	 ";
       							for(int i=1; i<=3; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"好 "; break;
										case 2: cout<<"的 "; break;
										case 3: cout<<"! "; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	  	 ______     "<<endl;
       													cout<<"		 				|  ___/   ~ "<<endl;
       													cout<<" 	  	  	  	  	  	| c●●  ~  "<<endl;
       													cout<<" 	  	  	  	  	  	 |    :==   "<<endl;
       													cout<<"  	  	  	  	  	 	 | |~       "<<endl<<endl;
       							Sleep(100);
       							cout<<" 	  	  	  	 ";
       							for(int i=1; i<=6; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"唉 "; break;
										case 2: cout<<"! "; break;
										case 3: cout<<"真 "; break;
										case 4: cout<<"麻 "; break;
										case 5: cout<<"烦 "; break;
										case 6: cout<<"! "; break;
									}
								}
								Sleep(2000);
								system("cls");
								jiazai();
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<" 	  	  	  	 	  	 ______     "<<endl;
       													cout<<"		 				|  ___/   ~ "<<endl;
       													cout<<" 	  	  	  	  	  	| c●●  ~  "<<endl;
       													cout<<" 	  	  	  	  	  	 |    :==   "<<endl;
       													cout<<"  	  	  	  	  	 	 | |~       "<<endl<<endl;
       							cout<<"											" ;
       							for(int i=1; i<=6; i++)
								{	
									Sleep(300);
									switch(i)
									{
										case 1: cout<<"就 "; break;
										case 2: cout<<"是 "; break;
										case 3: cout<<"这 "; break;
										case 4: cout<<"了 "; break;
										case 5: cout<<"! "; break;
										case 6: cout<<"抓 !"; break;
									}
								}
								Sleep(2000);
								system("cls");
								cout<<endl<<endl<<endl<<endl<<"					新建任务:爬上烂尾楼,001的所在地!  时间限时:2min"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					|    ———        ———    |"<<endl;
								cout<<"					|     |   |         |   |    |"<<endl;
								cout<<"					|    ———        ———    |"<<endl;
								cout<<"					|                            |"<<endl;
								cout<<"					|    ———        ———    |"<<endl;
								cout<<"					|     |   |         |   |    |"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					|————|"<<endl;
								cout<<"					|———————|"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					|—        ————      ——|"<<endl;
								cout<<"					|—        —————————|"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					|————                ——|"<<endl;
								cout<<"					|————  —            ——|"<<endl;
								cout<<"					|———                    —|"<<endl;
								cout<<"					|——————————————|"<<endl;
								cout<<"					-——————————————-"<<endl;
								
}

目前,只有一处可操作,请谅解!!!

MSG小游戏,2020/11/6

c++小游戏

 

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值