赞
踩
没啥好说的,更新了一关,上代码
- #include"bits/stdc++.h"
- #include"Windows.h"
- #define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
- using namespace std;
- int w=3,s=3,a=3,d=3;
- bool n=false,ip=true,m=false;
- void guize(){
- system("cls");
- cout<<"\n\n 1.本次更新不仅修复了像变量未重置,第三关未按路线走不死亡的bug\n";
- cout<<" 2.更新到了第五关,难度逐步提升,第\n 二关E建破坏墙体过关,死亡需重新\n 来,第三关的提示很明显,剩的自己去摸索吧\n 第四关与S建有关\n 第五关到出口之后按E建出去\n 第六关到指定位置按E建获得密码再按Q键输入密码即可通关\n 第七关因为你被保安打伤了,要在血流尽前自救\n";
- cout<<" 3.给个点赞加关注不过分吧~\n";
- cout<<" 4.此作品为奇葩博士原创,无抄袭行为\n";
- system("pause");
- }
- int home(){
- while(1){
- system("cls");
- cout<<"\n\n\n\n\n\n =======\033[32;1m宝强越狱\033[0m=======\n\n\n";
- cout<<" ======\033[33;1m1.游戏开始\033[0m======\n";
- cout<<" ======\033[34;1m2.关于游戏\033[0m======\n";
- cout<<" ======\033[31;1m3.退出游戏\033[0m======\n";
- if(KEY_DOWN(49)) break;
- if(KEY_DOWN(50)) guize();
- if(KEY_DOWN(51)){
- m=true;
- return 0;
- }
- Sleep(100);
- }
- system("cls");
- cout<<"\n\n\n\n\n\n 2024年2月28日,有一青年入狱";
- Sleep(3000);
- system("cls");
- cout<<"\n\n\n\n\n\n 现在你是这个青年,名叫宝强,你要逃出危机四伏的监狱";
- Sleep(3000);
- system("cls");
- cout<<"\n\n\n\n\n\n 游戏开始!";
- Sleep(3000);
- return 0;
- }
- void first(){
- a=3;
- d=3;
- w=3;
- s=3;
- cout<<"\n\n\n\n\n\n 第一关:寻找出路";
- Sleep(3000);
- system("cls");
- while(n==false){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if(w==0&&a==0) n=true;
- Sleep(100);
- system("cls");
- }
- }
- void second(){
- int HP=40;
- a=3;
- d=3;
- w=6;
- s=0;
- n=false;
- cout<<"\n\n\n\n\n\n 第二关:雷霆击碎黑暗";
- Sleep(3000);
- system("cls");
- while(n==false){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<"█";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if(KEY_DOWN(69)) HP--;
- if(HP==0) n=true;
- Sleep(100);
- system("cls");
- }
- cout<<"█████████\n";
- cout<<"█ █\n";
- cout<<"█ █\n";
- cout<<"█ █\n";
- cout<<"█ █\n";
- cout<<"█ █\n";
- cout<<"█ █\n";
- cout<<"█ \033[32;1m●\033[0m █\n";
- cout<<"█████████\n";
- Sleep(2000);
- }
- int third(){
- a=3;
- d=3;
- w=6;
- s=0;
- n=false;
- ip=true;
- cout<<"\n\n\n\n\n\n 第三关:幻影小道";
- Sleep(3000);
- system("cls");
- while(n==false&&ip==true){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- cout<<" \n";
- cout<<" # \n";
- cout<<" # \n";
- cout<<" ### \n";
- cout<<" # \n";
- cout<<" ### \n";
- cout<<" # \n";
- cout<<" # \n";
- cout<<" \n";
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if((a==3&&s==0)||(a==3&&s==1)||(s==2&&(a==3||a==4||a==5))||(s==4&&(a==3||a==4||a==5))||(a==3&&s==5)||(a==3&&s==6)||(s==3&&a==5)) ip=true;
- else{
- system("cls");
- cout<<"\n\n\n\n\n\n \033[31;1m你失败了!\033[0m\n\n\n\n\n\n";
- Sleep(3000);
- ip=false;
- }
- if(a==3&&s==6) n=true;
- Sleep(50);
- system("cls");
- }
- }
- void fourth(){
- a=4;
- d=4;
- n=false;
- ip=true;
- cout<<"\n\n\n\n\n\n 第四关:12345";
- Sleep(3000);
- system("cls");
- while(n==false&&ip==true){
- cout<<"██████████\n";
- cout<<"|1|2|3|4|5|\n";
- cout<<"|";
- for(int i=0;i<a;i++) cout<<" ";
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++) cout<<" ";
- cout<<"|\n";
- cout<<"██████████\n";
- if(KEY_DOWN(65)){
- if(a>0&&d<=7)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<7)
- {
- a++;
- d--;
- }
- }//d
- if(a==0&&KEY_DOWN(83)){
- n=true;
- }
- if((a==0&&KEY_DOWN(87))||(a==2&&KEY_DOWN(87))||(a==4&&KEY_DOWN(87))||(a==6&&KEY_DOWN(87))||(a==8&&KEY_DOWN(87))){
- system("cls");
- cout<<"\n\n\n\n\n\n \033[31;1m你失败了!\033[0m\n\n\n\n\n\n";
- Sleep(3000);
- ip=false;
- }
- Sleep(100);
- system("cls");
- }
- }
- void fifth(){
- a=3;
- d=3;
- w=6;
- s=0;
- n=false;
- ip=true;
- cout<<"\n\n\n\n\n\n 第五关:看不见的陷阱";
- Sleep(3000);
- system("cls");
- while(n==false&&ip==true){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- cout<<" \n";
- cout<<" \033[31;1m*******\033[0m \n";
- cout<<" \033[31;1m*\033[0m \n";
- cout<<" \033[31;1m*\033[0m \n";
- cout<<" \033[31;1m*\033[0m \n";
- cout<<" \033[31;1m*\033[0m \n";
- cout<<" \n";
- cout<<" \n";
- cout<<" \n";
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if((w==0&&d==2)&&KEY_DOWN(69)){
- n=true;
- }
- if((a==3&&(s==1||s==2||s==3||s==4||s==5))||(s==6&&(a==0||a==1||a==2||a==3||a==5||a==6))){
- system("cls");
- cout<<"\n\n\n\n\n\n \033[31;1m你失败了!\033[0m\n\n\n\n\n\n";
- Sleep(3000);
- ip=false;
- }
- Sleep(100);
- system("cls");
- }
- }
- int sixth(){
- a=3;
- d=3;
- w=6;
- s=0;
- int l,k=142857;
- n=false;
- ip=true;
- m=false;
- cout<<"\n\n\n\n\n\n 第六关:找密码";
- Sleep(3000);
- system("cls");
- while(n==false&&ip==true){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if(w==3&&s==3&&a==3&&d==3&&KEY_DOWN(69)) m=true;
- if(m==true){
- cout<<"142857\n";
- if(KEY_DOWN(81)){
- cin>>l;
- Sleep(1000);
- if(k==l) return 0;
- if(k!=l){
- cout<<"\033[31;1m密码错误!\033[0m";
- Sleep(3000);
- l=0;
- }
- }
-
- }
- Sleep(100);
- system("cls");
- }
- return 0;
- }
- void seventh(){
- a=3;
- d=3;
- w=6;
- s=0;
- long long k=100;
- n=false;
- ip=true;
- m=false;
- cout<<"\n\n\n\n\n\n 第七关:找绷带";
- Sleep(3000);
- system("cls");
- while(k!=0){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- cout<<"时间"<<k;
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if(w==5&&a==1&&KEY_DOWN(69)){
- n==true;
- break;
- }
- Sleep(100);
- system("cls");
- k--;
- }
- }
- eighth(){
- a=3;
- d=3;
- w=6;
- s=0;
- n=false;
- cout<<"\n\n\n\n\n\n 第八关:找枪";
- Sleep(3000);
- system("cls");
- while(1){
- cout<<"█████████\n";
- for(int i=0;i<w;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█";
- for(int i=0;i<a;i++){
- cout<<" ";
- }
- cout<<"\033[32;1m●\033[0m";
- for(int i=1;i<d;i++){
- cout<<" ";
- }
- cout<<"█\n";
- for(int i=0;i<s;i++){
- cout<<"█";
- for(int j=0;j<7;j++) cout<<" ";
- cout<<"█\n";
- }
- cout<<"█████████\n";
- if(KEY_DOWN(87)){
- if(w>0&&s<=6)
- {
- w--;
- s++;
- }
- }//w
- if(KEY_DOWN(83)){
- if(s>0&&w<=6)
- {
- w++;
- s--;
- }
- }//s
- if(KEY_DOWN(65)){
- if(a>0&&d<=5)
- {
- a--;
- d++;
- }
-
- }//a
- if(KEY_DOWN(68)){
- if(d>0&&a<5)
- {
- a++;
- d--;
- }
- }//d
- if(w==0&&a==0&&KEY_DOWN(69)){
- n==true;
- break;
- }
- Sleep(100);
- system("cls");
- }
- }
- int main(){
- while(!KEY_DOWN(51)){
- while(!KEY_DOWN(51)){
- home();
- if(m==true){
- return 0;
- }
- system("cls");
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- first();
- system("cls");
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- second();
- system("cls");
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- third();
- if(ip==false){
- break;
- }
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- fourth();
- if(ip==false){
- break;
- }
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- fifth();
- if(ip==false){
- break;
- }
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- sixth();
- if(ip==false){
- break;
- }
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- seventh();
- if(n==false){
- break;
- }
- Sleep(1000);
- if(KEY_DOWN(51)){
- return 0;
- }
- eighth();
- if(n==false){
- break;
- }
- Sleep(1000);
- system("cls");
- cout<<"\n\n\n\n\n\n \033[33;1m越狱成功!\033[0m\n\n\n\n\n\n";
- Sleep(3000);
- }
- }
- }
也就676行
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。