蒟蒻正准备编一个简单小游戏(cpp)
  • 板块灌水区
  • 楼主zyz1384959
  • 当前回复21
  • 已保存回复21
  • 发布时间2023/2/3 20:34
  • 上次更新2023/10/24 01:50:30
查看原帖
蒟蒻正准备编一个简单小游戏(cpp)
750416
zyz1384959楼主2023/2/3 20:34

蒟蒻正准备编一个简单小游戏(cpp),目前的代码公开,大佬请指导(由于长度限制,只能运行了)

#include<bits/stdc++.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <windows.h>
#include <mmsystem.h>
#include<dsound.h>
#pragma comment(lib, "WINMM.LIB")
#define f(a,b,c) for(int a=b;a<=c;a++) 
#define clean system("cls");
using namespace std;
string mainoutputart[100][50]=
{
	{//1
	"--------------------------------------------------------------------------------",
	"|-----------------------   ==========================   -----------------------|",
	"|   3                  ----|00000     0     0   00  |----   ~                  |",
	"|          ------      ~   |0   00   0 0    0  0    |   J      ------  #  ~ #  |",
	"|        `   #    ---      |00000   0   0   000    e|      ----                |",
	"|  #                 ---   |0   00 0000000  0  0    |   ---        U     #  G  |",
	"|        #       D      ---|0000  0       0 0   00  |---     ~        ~        |",
	"|             `   #     ~  |                        |     #  ~        #      ` |",
	"|  ` A   ~     --------    |0  00000  000    000    |    --------  S    ~  #   |",
	"|               ~    ------| 00      0   0  0   0   |------                    |",
	"|    #   ~    ~            | 0       0   0  0   0   |       ~             # `  |",
	"|                          | 0       0   0  0   0   |   T     #      `         |",
	"|  `     ~ #   #     ------| 0        000    000    |------     `       ~   U  |",
	"|              --------    |                        |    --------   U          |",
	"| `    #     `          #  |      0         0       |                    3     |",
	"| ~               #   ` ---|     0 0       0 0      |---   #       `   ~       |",
	"|      V   #     ~   ---   |    0   0     0   0     |   ---      D             |",
	"|  #              ---      |   0     0   0     0    |   J  ---         #   ~   |",
	"|     ~     ------       ` |  0       0 0       0   |     `   ------        O  |",
	"|  `     #        `  # ----| 0         0         0  |----   #             `    |",
	"|-----------------------   ==========================   -----------------------|",
	"|==============================================================================|",
	"|@ZYZ BY 2023 JIAO ZUO/20TH MIDLE SCHOOL      thank for playing                |",
	"|WAITING......                                                                 |",
	"-------------------------------------------------------------------------------"
	},
	{//2
	"--------------------------------------------------------------------------------",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"-------------------------------------------------------------------------------"	
	},
	{//3
	"--------------------------------------------------------------------------------",
	"|后室加载中...                                                                 |",
	"|(waiting.)                                                                    |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"-------------------------------------------------------------------------------"
	},
	{//4
	"--------------------------------------------------------------------------------",
	"|后室加载中...                                                                 |",
	"|(waiting..)                                                                   |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"-------------------------------------------------------------------------------"
	},
	{//5
	"--------------------------------------------------------------------------------",
	"|后室加载中...                                                                 |",
	"|(waiting...)                                                                  |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"-------------------------------------------------------------------------------"	
	},
	{//6
	"--------------------------------------------------------------------------------",
	"|                                    后室                                      |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	},
	{//7
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *  ->开始游戏(本意)        *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *      导出                      *                 |",
	"|                           *      设置                       *                |",
	"|                           *      说明                        ***             |",
	"|                           *      调试库                         *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|选择:ws,空格                                                        作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	},
	{//8
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *   ->导入(导入存档)            *                 |",
	"|                           *      导出                      *                 |",
	"|                           *      设置                       *                |",
	"|                           *      说明                        ***             |",
	"|                           *      调试库                         *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	}, 
	{//9
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *    ->导出(导出存档)            *                 |",
	"|                           *      设置                       *                |",
	"|                           *      说明                        ***             |",
	"|                           *      调试库                         *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	}, 
	{//10
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *      导出                      *                 |",
	"|                           *    ->设置(本意)                 *                |",
	"|                           *      说明                        ***             |",
	"|                           *      调试库                         *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	}, 
	{//11
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *      导出                      *                 |",
	"|                           *      设置                       *                |",
	"|                           *    ->说明(教程)                  ***             |",
	"|                           *      调试库                         *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	}, 
	{//12
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *      导出                      *                 |",
	"|                           *      设置                       *                |",
	"|                           *      说明                        ***             |",
	"|                           *    ->调试库(你猜)                   *            |",
	"|                            *     制作感言                ********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|(其实就是调用函数(提示/help))                                        作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	}, 
	{//13
	"--------------------------------------------------------------------------------",
	"|                                   后室                                       |",
	"|                               *********                                      |",
	"|                              *         *                                     |",
	"|                             *           *                                    |",
	"|                             *            ***************                     |",
	"|                             *    开始游戏              *****                 |",
	"|                            *     导入                      *                 |",
	"|                           *      导出                      *                 |",
	"|                           *      设置                       *                |",
	"|                           *      说明                        ***             |",
	"|                           *      调试库                         *            |",
	"|                            *   ->制作感言(作者的体会心得)********            |",
	"|                   **********                        **********               |",
	"|                  *                                *                          |",
	"|                  *                               *                           |",
	"|                  *                      *********                            |",
	"|                  *                      *                                    |",
	"|                  *                      *         ***                        |",
	"|                   ********              *          ****                      |",
	"|                          ****************          ***                       |",
	"|                                                                              |",
	"|                                                                              |",
	"|                                                                     作者:ZYZ|",
	"-------------------------------------------------------------------------------"	
	},  
	{//14
	"--------------------------------------------------------------------------------",
	"作者(这是制作感言,写了,但不能看)
	"-------------------------------------------------------------------------------"	
	},
	{//15
	"--------------------------------------------------------------------------------",
	"|生命值     |体力值     |饥饿值     |摄水量       |sans值//1   |背包//2        |",
	"|--------------------------------------------------------------|               |",
	"|//62*15 最终完美屏幕比:31*15                      //3        |               |",
	"|*树木                                                         |               |",
	"|o石块                                                         |               |",
	"|%矿物                                                         |               |",
	"|!交互点                                                       |               |",
	"||/-墙                                                         |               |",
	"|@主角                                                         |               |",
	"|:门                            地图                           |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|--------------------------------------------------------------|---------------|",
	"|//3                                                           |//4            |",
	"|对话框                                                        |其他信息       |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                  (空格键退出)|               |",
	"-------------------------------------------------------------------------------"	
	},
	{//16
	"--------------------------------------------------------------------------------",
	"|-----------------------   ==========================   -----------------------|",
	"|   3                  ----|                        |----   ~                  |",
	"|          ------      ~   |                        |   J      ------  #  ~ #  |",
	"|        `   #    ---      |                        |      ----                |",
	"|  #                 ---   |                        |   ---        U     #  G  |",
	"|        #       D      ---|                        |---     ~        ~        |",
	"|             `   #     ~  |                        |     #  ~        #      ` |",
	"|  ` A   ~     --------    |                        |    --------  S    ~  #   |",
	"|               ~    ------|                        |------                    |",
	"|    #   ~    ~            |                        |       ~             # `  |",
	"|                          |                        |   T     #      `         |",
	"|  `     ~ #   #     ------|                        |------     `       ~   U  |",
	"|              --------    |                        |    --------   U          |",
	"| `    #     `          #  |                        |                    3     |",
	"| ~               #   ` ---|                        |---   #       `   ~       |",
	"|      V   #     ~   ---   |                        |   ---      D             |",
	"|  #              ---      |                        |   J  ---         #   ~   |",
	"|     ~     ------       ` |                        |     `   ------        O  |",
	"|  `     #        `  # ----|                        |----   #             `    |",
	"|-----------------------   ==========================   -----------------------|",
	"|==============================================================================|",
	"|@ZYZ BY 2023 JIAO ZUO/20TH MIDLE SCHOOL      thank for playing                |",
	"|WAITING......                                                                 |",
	"-------------------------------------------------------------------------------"
	},	 
	};
string gamemode[50]={
	"--------------------------------------------------------------------------------",
	"|           |           |           |           |              |背包           |",
	"|--------------------------------------------------------------|               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|--------------------------------------------------------------|---------------|",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"|                                                              |               |",
	"-------------------------------------------------------------------------------"
};
string gamingstart[1100]={
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
    "                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                  * tree       |--------------------------------------------------------------------|                                                                    ",
	"                                       --------| ***           ***                                   |BBBBBBBBBBBBBB|                                                                    ",
	"                                       |         ***           ***                                   |             B|                                                                    ",
	"                                  |----- ------| ***           ***                                   |             B|                                                                    ",
	"                                  |{     ======|                                                     [             B|                                                                    ",
	"                                  |{     ======|+++  +++++++  ++++++++++  +++++++++++  +++++         |             B|                                                                    ",
	"                                  |{     ======|+######+##########+ ########### +##########+         |             B|                                                                    ",
	"                                  |{          +|+######+##########+ ########### +##########+         |BBBBBBBBBBBBBB|                                                                    ",
	"                                  |           #|-------------------------------------------------- ------------------                                                                    ",
	"                                  -------- -----|-------------------------------------------|    | |                                                                                     ",
	"                                         | |    |B            ##################       ~~~##|    | |                                                                                     ",
	"                                         | |    |B                                     ~~~##|    | |                                                                                     ",
	"                                         | |    |B                                          |    | |                                                                                     ",
	"                                         | |    |B           |                  |           |    | |                                                                                     ",
	"                                    |----- -----|B           <XXXXXXXXXXXXXXXXXX>           |----- ------                                                                                ",
	"                                    |                         ------------------            |           |                                                                                ",
	"                                    |  |--------|                                           [           [                                                                                ",
	"                                    |  |B box   |                                           |           |                                                                                ",
	"                                    |  |= bed   |                                           |------------                                                                                ",
	"                                    |  |{cabinet|   NNN                                     |[or]door                                                                                    ",
	"                                  |--  --|      |(  NNN  )                 I##              |                                                                                            ",
	"                                  |B    }|      |   NNN      I^^I          I##     |O|||||O||      //44,4                                                                                ",//x21,y4
	"                                  |===  }|      |            I^^I          WWWWWWWwWWWWWWWWW|                                                                                            ",
	"                                  --------      |-------------------------------------------|                                                                                            ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
    "                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	"                                                                                                                                                                                         ",
	

}; 
//char gamemap[60][60];
int mainnum=0,choose=1;
long long gamingmapture;
bool began=1;
//char m[1121][1121];
//long long num,x=51,y=61,x2=51,y2=61,x3=56,y3=56,xy=1;
//double tili=100.5,food=10,shi=10,shu=10,kang=10,hg=1,tie=3,jin=1,hz=0,hc=0,live=5;
//long long ta=0,hj=0,chj=0,yxhj=0,day=0;
//bool r=0;
//char a,b,c;
int mainoutput(int a)
{
	
		f(n,0,29)
			cout<<mainoutputart[a][n];	
}
int mainchoose()
{//7~13
	char a;
	bool t=0;
		clean
		mainoutput(choose+5);
		a=getch();
		if(a=='s')
		{
			if(choose==7)
			choose=1;
			else
			choose++;
			mainchoose(); 
	    }
	    if(a=='w')
		{
			if(choose==1)
			choose=7;
			else
			choose--;
			mainchoose(); 
	    }
	    if(a==' ')
	    {
	    	t=1;
	    	if(choose==1)
	    	{
	    		
			}
			if(choose==2)
	    	{
	    		
			}
			if(choose==3)
	    	{
	    		
			}
			if(choose==4)
	    	{
	    		
			}
			if(choose==5)
	    	{
	    		bool choose5=1;
				char a55;
				while(choose5)
				{
				    clean
				    mainoutput(14);
					a55=getch();
					if(a55==' ')
					{
						mainchoose();
						choose5=0;
					}
						
				}	
			}
			if(choose==6)
	    	{
	    		bool choose6=1;
				string a66;
				int x,y,z;
				while(choose6)
				{
				    clean
				    cout<<"Waiting for input...( /back to back)"<<endl;	
					cin>>a66;
					if(a66=="/back")
					{
					mainchoose();
					choose6=0;
					}
					if(a66=="/mainoutput")
					{
					cout<<"input x:"<<endl;
					cin>>x;
					clean
					mainoutput(x);
					system("pause");
					mainchoose();
					}
					else
					{
					clean
					cout<<"(The input is not in the correct format!)";
					Sleep(3000);
					mainchoose();
					choose6=0;
					}	
				}	
			}
			if(choose==7)
	    	{
	    		bool choose7=1;
				char a77;
				while(choose7)
				{
				    clean
				    mainoutput(13);
					a77=getch();
					if(a77==' ')
					{
						mainchoose();
						choose7=0;
					}
						
				}							
			}
		}
		else
		mainchoose();
}
long gamingmap(long long gamingmapnumber,long gamingmapx,long long gamingmapy)//负责打印地图
{						 //地图序号			  //x坐标			   //y坐标 
//	if(a=='w'&&tili>=0.5&&m[x3-1][y3]==' ')
//	{
//	
//		xy=1;
//		tili-=0.5;
//		x--;
//		y--;
//		b=m[x3-1][y3];
//		x3--;
//		m[x3][y3]='@';
//		m[x3+1][y3]=b;
//	    system("CLS");
//	    f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 	
	//31*15
	//1.从地图模板搬到gamemap 2.把gamemap搬到空白地图模板上
	if(gamingmapnumber==1)
	{
		f(i,1,31)
			f(j,1,15)
			{
				
			}	
	} 
}
int main()
{
	srand(time(NULL));
//	string a,b,c;
//	cin>>a>>b>>c;
//	ofstream out("CODE.txt");
////	ofstream out2("Data.ini",ios::app); //ios::app表示追加输出,不覆盖原内容
//	out<<a<<endl;
////	out2<<b<<endl<<c;
//	out.close(); 
////	out2.close();
//https://wwpai.cn/thread-1937533-1-1.html

//begin//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//	f(i,1,10)
	//	{
	//		Sleep(rand()%200);
	//		mainnum=i%2;
	//		mainoutput(mainnum);
	//		Sleep(25);
	//		system("cls");
	//	}
	mainoutput(0); 
	Sleep(3000);
	system("pause");	
	f(i,1,rand()%3)
	{
		mainoutput(2);
		Sleep(1000);
		system("cls");
		mainoutput(3);
		Sleep(1000);
		system("cls"); 
		mainoutput(4);
		Sleep(1000);
		system("cls"); 	
	}	
	mainoutput(5);
	mainchoose();
	
	
//    int a=0;
//    while(1)
//    {
//    	if(GetAsyncKeyState(VK_LBUTTON)&0x01)
//    	cout<<"0000000000000000000000000"<<endl;
//    	a++;
//    		cout<<a<<endl;
//    		Sleep(100);
//	}
 	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
//	cout<<"初始化地图中,请稍后。。。。。。"<<endl;	
//	f(i,1,1111)
//		f(j,1,1111) 
//		{
//		int then=rand();
//		if(then%7==0) 
//			m[i][j]='*';
//		else
//		if(then%23==1)	
//			m[i][j]='.';
//		else
//		if(then%101==1)	
//			m[i][j]='%';	
//		else
//		m[i][j]=' ';
//		} 
//	Sleep(2000);
//	m[56][56]='@';
//	f(i,51,61)
//	{
//		f(j,51,61) 
//		cout<<m[i][j]<<" ";
//		cout<<endl;
//	}
//	cout<<"随机地图生成完成:!!!"<<endl;
//	cout<<"游戏规则:w,s,a,d移动,r吃食物,t采集,e打开背包,q建筑(半成品)"<<endl;
//	
//	
//	for(;;)
//	{
//	if(live>10)
//	live=10;
//	a=getch();
//	if(a=='t'&&food>=1)
//	{
//		
//		tili+=10;
//		if(tili>100)
//		tili=100;
//		food--;
//		system("CLS");
//		 f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//	}
//	if(a=='w'&&tili>=0.5&&m[x3-1][y3]==' ')
//	{
//	
//		xy=1;
//		tili-=0.5;
//		x--;
//		y--;
//		b=m[x3-1][y3];
//		x3--;
//		m[x3][y3]='@';
//		m[x3+1][y3]=b;
//	    system("CLS");
//	    f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//	}
//	else
//	if(a=='s'&&tili>=0.5&&m[x3+1][y3]==' ')
//	{
//		xy=2;
//		tili-=0.5;
//		x++;
//		y++;
//		b=m[x3+1][y3];
//		x3++;
//		m[x3][y3]='@';
//		m[x3-1][y3]=b;
//	    system("CLS");
//	    f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//	}
//	else
//	if(a=='a'&&tili>=0.5&&m[x3][y3-1]==' ')
//	{
//		xy=3;
//		tili-=0.5;
//		x2--;
//		y2--;
//		b=m[x3][y3-1];
//		y3--;
//		m[x3][y3]='@';
//		m[x3][y3+1]=b;
//	    system("CLS");
//	    f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//	}
//	else
//	if(a=='d'&&tili>=0.5&&m[x3][y3+1]==' ')
//	{
//		xy=4;
//		tili-=0.5;
//		x2++;
//		y2++;
//		b=m[x3][y3+1];
//		y3++;
//		m[x3][y3]='@';
//		m[x3][y3-1]=b;
//	    system("CLS");
//	    f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
// 
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//	}
//		if(a=='y'&&tili>=0.5)
//		{
//			tili-=0.5;
//			if(xy==1) 
//			{
//				if(m[x3-1][y3]=='*') 
//				shu++;
//				if(m[x3-1][y3]=='.') 
//				shi++;
//				if(m[x3-1][y3]=='%') 
//				kang++;
//				m[x3-1][y3]=' ';
//				
//			}
//			
//			if(xy==2) 
//			{
//				if(m[x3+1][y3]=='*') 
//				shu++;
//				if(m[x3+1][y3]=='.') 
//				shi++;
//				if(m[x3+1][y3]=='%') 
//				kang++;
//				m[x3+1][y3]=' ';
//				
//			}
//			if(xy==3) 
//			{
//				if(m[x3][y3-1]=='*') 
//				shu++;
//				if(m[x3][y3-1]=='.') 
//				shi++;
//				if(m[x3][y3-1]=='%') 
//				kang++;
//				m[x3][y3-1]=' ';
//				
//			}
//			if(xy==4) 
//			{
//				if(m[x3][y3+1]=='*') 
//				shu++;
//				if(m[x3][y3+1]=='.') 
//				shi++;
//				if(m[x3][y3+1]=='%') 
//				kang++;
//				m[x3][y3+1]=' ';
//			}
//		system("CLS");
//		 f(i,x,y)
//		{
//			f(j,x2,y2) 
//			cout<<m[i][j]<<" ";
//			cout<<endl;
//		}
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//		}
//		
//		
//		if(a=='q')
//		{
//			system("CLS");
//			cout<<"合成表:"<<endl;
//			cout<<"1----墙(建筑):3个石块,2个矿石"<<endl;
//			cout<<"2----篝火(建筑):3个石块    5个木材"<<endl;
//			cout<<"3----帐篷(建筑):5个木材,5个石块,2个矿石"<<endl;
//			cout<<"4----采矿机(建筑):5个铁,2个矿石,5个木材,3个石头"<<endl;
//			
//			cout<<"5----铁(材料):1个石块,3个矿石"<<endl;
//			cout<<"6----金(材料):1个铁,3个矿石"<<endl;
//			cout<<"7----炭(材料):1个矿石,5个木材"<<endl;  
//			cout<<"8----合金(材料):2个铁,1个金,2个炭,3个矿石"<<endl;  //
//			cout<<"9----超合金(材料):3个合金,3个矿石,3个炭"<<endl;  //
//			cout<<"0----外星合金(材料):5个超合金,2个金"<<endl;
//			cout<<"i----热食(马上食用)(食物):1个食物,3个木材"<<endl;  //
//			b=getch();
//			if(b>='1'&&b<='4')
//			{
//				
//				if(b=='1'&&shi>=3&&kang>=2)
//				{
//					r=1;
//					shi-=3;
//					kang-=2;
//					b='#';
//					hg++;
//					food+=5;
//				}
//				
//					if(b=='2'&&shi>=3&&shu>=5)              
//				{
//					r=1;
//					shi-=3;
//					shu-=5;
//					b='^';
//					hg++;
//					food+=5;
//				}
//				
//				if(b=='3'&&shu>=5&&shi>=5&&kang>=2)
//				{
//					r=1;
//					shu-=5;
//					shi-=5;
//					kang-=2;
//					b='&';
//					hz++;
//					hg++;
//				}
//				
//				if(b=='4'&&tie>=5&&shu>=5&&kang>=2&&shi>=3)
//				{
//					r=1;
//					shu-=5;
//					tie-=5;
//					shi-=3;
//					kang-=2;
//					b='X';
//					hc++;
//				}
//				
//				if(xy==1&&r==1) m[x3-1][y3]=b;
//				if(xy==2&&r==1) m[x3+1][y3]=b;
//				if(xy==3&&r==1) m[x3][y3-1]=b;
//				if(xy==4&&r==1) m[x3][y3+1]=b;
//				
//				r=0;
//				system("CLS");
//			    f(i,x,y)
//				{
//					f(j,x2,y2) 
//					cout<<m[i][j]<<" ";
//					cout<<endl;
//				}
//
//			}
//			if(b>='5'&&b<='9')
//			{
//				if(b=='5'&&shi>=1&&kang>=3)
//				{
//					shi--;
//					kang-=3;
//					tie++;
//				}
//				
//				if(b=='6'&&tie>=1&&kang>=3)
//				{
//					tie-=2;
//					kang-=3;
//					jin++;
//				}
//				
//				if(b=='7'&&kang>=1&&shu>=5)
//				{
//					kang-=1;
//					shu-=5;
//					ta++;
//				}
//				
//				if(b=='8'&&tie>=2&&jin>=1&&ta>=2&&kang>=3)
//				{
//					tie-=2;
//					jin-=1;
//					ta-=2;
//					kang-=3;
//					hj++;
//				}
//				
//				if(b=='9'&&hj>=3&&kang>=3&&ta>=3)
//				{
//					hj-=3;
//					kang-=3;                                         
//					ta-=3;
//					chj++;
//				}		 
//			} 
//			
//			if(b=='0'&&chj>=5&&jin>=2)
//			{
//				chj-=5;
//				jin-=2;
//				yxhj++;	
//			} 
//			
//			if(b=='i'&&food>=1&&shu>=3)
//				{
//					food--;
//					shu-=3;
//					tili+=20;
//					live++;
//				}
//		
//		}
//		
//		if(a=='e')
//		{
//		system("CLS");
//		cout<<"血量为:"<<live<<"	"<<"体力为:"<<tili<<"    "<<"方向为:"<<xy<<endl; 
//		cout<<"食物数为:"<<food<<"   "<<"坐标 "<<x3<<"  "<<y3<<"    "<<"天数为:"<<day<<endl; 
//		cout<<"木材为:"<<shu<<"	"<<"石头为:"<<shi<<"	"<<"矿石为:"<<kang<<endl; 
//		cout<<"铁为:"<<tie<<"    "<<"金为:"<<jin<<"    "<<"炭为:"<<ta<<endl; 
//		cout<<"合金为:"<<hj<<"    "<<"超合金为:"<<chj<<"    "<<"外星合金为:"<<yxhj; 
//		}
//		if(a==' ')
//		{
//			cout<<endl;
//			system("pause");	
//		}
//		if(a=='|')
//		{
//			food+=10;shu+=10;
//			shi+=10;kang+=10;
//			tie+=10;jin+=10;
//			ta+=10;hj+=10;
//			chj+=10;
//		}
////		if(day==1000)
////		return 0; 
//		kang+=hc/500;
//		food+=hg/1000;
//		live+=hz/1000;
//		shi+=hc/250; 
////		day+=1;
//		Sleep(100);
//	}
//

return 0;	
}
2023/2/3 20:34
加载中...