栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

游戏开始界面C++3.1

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

游戏开始界面C++3.1

#include
#include
#include
using namespace std;
string p=" M!|=.123456789%&_~?Win";
void color(int a)//打印颜色
{
    if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN|FOREGROUND_BLUE);
    if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);
    if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);
    if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);
    if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);
    if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);
    if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);
    if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
}
 
long long numberaio(string n){
    for (int i = 0; i < 100000; i++) {
        if(n[i]=='')
        {
            return i;
        }
    }
}
void coutAIO(string b,int happyday = 20,bool truefalse1 = 0){
    int i=0,s=0;
    long long a=numberaio(b);
    while(a!=0){
        s=rand()%9;
        if(a!=0&&s==0)
        {
            color(0);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==1)
        {
            color(1);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==2)
        {
            color(2);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==3)
        {
            color(3);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==4)
        {
            color(4);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==5)
        {
            color(5);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==6)
        {
            color(6);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==7)
        {
            color(7);
            cout << b[i];
            a--;
            i++;
        }
        if(a!=0&&s==8)
        {
            color(8);
            cout << b[i];
            a--;
            i++;
        }
        Sleep(happyday);
        
    }
    if(truefalse1!=false){
        system("cls");
        int getch(a);
    }
    
    cout << endl;
}
void ksjm()
{
	system("color f0");
	cout<<"按任意键开始游戏";
	getch();
	system("cls"); 
	for(long long i=1;i<=3;i++)
	{
		system("color 07");
		system("color 10");
		system("color 20");
		system("color 30");
		system("color 40");
		system("color 50");
		system("color 60");
		system("color 70");
		system("color 80");
		system("color 90");
		system("color a0");
		system("color b0");
		system("color c0");
		system("color d0");
		system("color e0");
		system("color f0");
	}
	cout<<"nnnnnnnnnnn                                                      ";
	coutAIO("走迷宫",2);
	cout<<"n";
	cout<<"                                                   ";
	coutAIO("出品:饼干,修改:努力的AIO",5);
	Sleep(1500);
} 
int start()
{
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一天,你坐着飞机,正打算去美国...",30);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("一边看着电影,一边喝着饮料",30);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□■□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□■■□□□□□□□□□□□□□□□□□■□□" << endl;
	cout << "□□□□□□■■■□□□□□□□□□□□□□□□■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■□□□□■■■■□□" << endl;
	cout << "□□■□■□■□■□■□■□■□■□■■■■■■■■□□" << endl;
	cout << "□□□■■■■■■■■■■■■■■■■■■■■■■□□□" << endl;
	cout << "□□□□□□□□■■■■■□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□■■■□□□□□□□□□□□□" << endl;
	coutAIO("突然,飞机开始颠簸,你手中饮料摔到了地上,洒了一地",30);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("一秒钟后,飞机开始往下坠落",30);
	Sleep(1000);
	system("cls");
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□■■■■□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□■■■■■■□□■■□□■■■■■■□□□□□□" << endl;
	cout << "□□□□□□□□□■■■■■■■■□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□■■■■■■□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□■■□□□□□□□□□□□□□□" << endl;
	cout << "□□□□□□□□□□□□□□□□□□□□□□□□□□□□" << endl;
	coutAIO("行李架上的行李掉了下来,砸中了你,你眼前一黑,昏了过去...",30);
	Sleep(1000);
	system("cls");
	Sleep(3000);
	coutAIO("醒来后,你发现你躺在石头上。");
	getch();
	return 0;
}
void start(int n)
{
	system("cls");
    cout<<"加载中请稍等";
    Sleep(1000);
    system("cls");
	for (int i=1;i<=n; i++)
	{
		cout<<"加载中."<jg)r=1;
	}
	system("cls");
	return ;
}
void sm()//说明
{
	system("cls");
	cout<<"nn		说明:nnn";
	cout<<"					按空格开始游戏后n";
	cout<<"					  Wn";
	cout<<"					A S D   移动n";
	cout<<"			按空格继续···";
	long long ok='';
	while(ok=getch(),ok!=' ');
	system("cls");
	return ;
}
void sd()//商店,可删除可不删
{
	system("cls");
	cout<<"nn		欢迎来到【X2G超市】!你想买什么?nnn";
	cout<<"			   		1.加血羹(加满血,花20金币)nnn";
	cout<<"			   		2.复活券nnn";
	int what;
	cin>>what;
	if(what==1){
	    
	}
	system("cls");
	return ;
}
 
void full_screen()
{   
    HWND hwnd = GetForegroundWindow();
    int cx = GetSystemMetrics(SM_CXSCREEN);            
    int cy = GetSystemMetrics(SM_CYSCREEN);            
 
    LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE);   
    
    SetWindowLong(hwnd,GWL_STYLE,( l_WinStyle |WS_MAXIMIZE| WS_POPUP) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER);//  
    SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0);
}
void hys()//背景
{
	system("cls");
	cout<<"nnnnnnnnn按1【日间色】n";
	cout<<"按2【夜间色】n";
	cout<<"按3【黑客】n";
	cout<<"按4【科幻】n";
	cout<<"按5【紫水晶】n";
	char s;
	s=getch();
	while(s!='1'&&s!='2'&&s!='3'&&s!='4'&&s!='5')s=getch();
	switch(s-'0')
	{
		case 1:
			system("color f0");
			break;
		case 2:
			system("color 0f");
			break;
		case 3:
			system("color 0a");
			break;
		case 4:
			system("color 09");
			break;
		case 5:
			system("color 01");
			break;
	}
	system("cls");
	return ;
}
int main()
{
    srand((unsigned)time(NULL));
    system("title 游戏名");
	system("color f0");
	coutAIO("要不要全屏(推荐全屏)?输入要或不要");
	string ytytyty;
	cin>>ytytyty;
	if (ytytyty=="要") {
		full_screen();
	}
    welcome();
	coutAIO("你眼里作者们帅不帅?",3);
    string a;
    cin >> a;
    if(a=="quasmajshsuhsjashasznjajazuozheshuaibi!shagsyqshqsyuqhsush&^$@$%^&*^#@!@#$%^&*()*&^%$#@!@#$%^&*(~!!!!!!!"||a=="我是作者你是神魔人"||a=="SBisme"||a=="帅死了helaxnhsnahaioshuwhsjsjajshuwhsuqu%^#"){
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈……");
        Sleep(1000);
        system("cls");
        coutAIO("竟然知道密码?这只是个样子而已,快退出吧!不然我放病毒了!给你五秒钟");
        Sleep(5000);
        system("cls");
	    if ( MessageBox(NULL, "我再问一句,你是不是聪明的?","问题", MB_ICONQUESTION|MB_YESNO) == IDYES );
	    else{
	        coutAIO("你也太不自信了吧!",3,1);
	        return 0;
	    }
		if (MessageBox (NULL, "你想玩下大神做的游戏么?我现在不放病毒,给你一个机会(胆小慎入,可能有病毒哦~)", "作者们", MB_YESNO) == IDYES) {
		    coutAIO("能闯过前面的关卡,你是个大胆、有自信、又懂代码的人!",30,1);
		}
		else {
		    coutAIO("胆小鬼!",3,1);
			return 0;
		}
        coutAIO("游戏正式开始!!!!!",5);
    }
    else{
        coutAIO("不会暗号的一边去!!!!!!!!!!!!!!");
        goto dad;
    }
    startone:
	dad:
    return 0;
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/957874.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号