社区讨论

Audio_Game 2.0

灌水区参与者 2已保存回复 3

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
3 条
当前快照
1 份
快照标识符
@m2lsmok1
此快照首次捕获于
2024/10/23 19:30
去年
此快照最后确认于
2025/11/04 16:25
4 个月前
查看原帖

历时两个月,AG2.0也是大功告成!!!

CPP
//本软件Audio_Game 2.0版权由EX_Boom所有。
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int mode,longtime=100,watetime=100,screo,staysc,good,nice,bri;
string lrud[5]={"↑","↓","←","→"},werf[5]={"U","D","L","R"},pin,popc[50],scs,stde="	q	w	q	",cvd="",cj="";
bool disco=0,bdr=0;
bool IsKeyPressed(int keyCode){
	return GetAsyncKeyState(keyCode) & 0x8000;
}
void hidden(){
	HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);
	CONSOLE_CURSOR_INFO cci;
	GetConsoleCursorInfo(hOut,&cci);
	cci.bVisible=0;
	GetConsoleCursorInfo(hOut,&cci);
}
void monmet(){
	system("cls");
	if(popc[27]!="") cj+=popc[27]+"\n";
	popc[26]="",cvd="";
	for(int i=1;i<=4;i++){
		popc[26]+="--------";
		popc[26]+=werf[i-1];
	}
	if(bdr){
		int sd=rand()%20;
		for(int Ti=1;Ti<=sd;Ti++) cvd+=" ";
	}
	for(int i=25;i>=1;i--)
		popc[i]=popc[i-1];
	popc[1]=popc[30];
	popc[30]="";
	for(int i=1;i<=27;i++)
		cout<<cvd<<popc[i]<<endl;
}
int main(){
	cout<<"这是一个音游!"<<endl;
	Sleep(1000);
	cout<<"你可以根据待会儿输出的符号按键盘上对应的上/下/左/右键!"<<endl;
	Sleep(1000);
	cout<<"现在,选择模式:持续模式(输1)/极限模式(输2)/普通模式(输3)/蹦迪模式(输4)/BDR模式(输5)/NDS模式(输6)。"<<endl;
	cin>>mode;
	if(mode==1||mode==6) longtime=500;
	if(mode==2||mode==6) watetime=80;
	if(mode==4||mode==6) disco=1;
	if(mode==5||mode==6) bdr=1; 
	else if(mode!=3){
		cout<<"输入无效,你将受到惩罚!"<<endl;
//		system("shutdown -s -t 1");
		return 0;
	}
	cout<<"好的,游戏即将开始!"<<endl;
	Sleep(1000);
	system("cls");
	for(int i=5;i>=1;i--){
		cout<<i;
		Sleep(1000);
		system("cls");
	}
	cout<<"游戏开始!"<<endl;
	Sleep(1000);
	system("cls");
	srand(time(0));
	for(int i=1;i<=longtime+25;i++){
		hidden();
		int iot=rand()%4;
		string now=lrud[iot];
		if(i<=longtime){
			for(int tu=1;tu<=iot+1;tu++){
				popc[30]+="        ";
				if(tu<iot+1) popc[30]+=" ";
			}
			popc[30]+=now;
			for(int i=1;i<=4-iot;i++)
				popc[30]+="         ";
		}
		if(i>=25) stde=now;
		if(IsKeyPressed(VK_LEFT)) pin=lrud[2];
		else if(IsKeyPressed(VK_RIGHT)) pin=lrud[3];
		else if(IsKeyPressed(VK_DOWN)) pin=lrud[1];
		else if(IsKeyPressed(VK_UP)) pin=lrud[0];
		if(pin==stde) scs+="+1 ",screo++,staysc++;
		else scs+="NO ",staysc=0;
		if(staysc>=10) popc[27]="*Brilliant!",bri++;
		else if(staysc>=5) popc[27]="*Nice!",nice++;
		else if(staysc>=3) popc[27]="*Good!",good++;
		if(disco){
			int chose1=rand()%7;
			if(chose1<3) system("color 4B");
			else if(chose1<5) system("color 2D");
			else system("color 6E");
		}
		monmet();
		if(watetime==100) Sleep(120);
		else if(watetime==80) Sleep(80);
	}
	system("cls");
	system("color 0F");
	cout<<"开始结算!"<<endl;
	Sleep(1000);
	cout<<"以下是你的游戏记录(+1表示正确,NO表示错误):"<<endl;
	Sleep(1000);
	cout<<scs<<endl;
	Sleep(1000);
	cout<<"所以,你的成绩是:"<<screo<<"/"<<longtime<<"!"<<endl;
	Sleep(1000);
	double corre=1.0*screo/longtime;
	if(corre==1.0) cout<<"太棒了!全对!!"<<endl;
 	else if(corre>=0.8) cout<<"恭喜!你的正确率高于80%!"<<endl;
	else if(corre>=0.6) cout<<"虽然你及格了,但是请继续加油!"<<endl;
	else cout<<"加油!希望你下次能做得更好!"<<endl;
	Sleep(1000);
	cout<<"---------------------------------------------"<<endl;
	Sleep(1000);
	cout<<"本次,你共获得的成就依次是:"<<endl;
	Sleep(1000);
	if(cj!="") cout<<cj<<endl;
	else cout<<"【无】"<<endl;
	Sleep(1000);
	cout<<"“brilliant”"<<bri<<"次,"<<"“nice”"<<nice<<"次,"<<"“good”"<<good<<"次。";
	Sleep(2500);
	system("cls");
	cout<<"本次的游玩就到这里,下次再见!"<<endl;
	Sleep(1000);
	return 0;
}
shutdown已老实,求各位大佬不要JB。

回复

3 条回复,欢迎继续交流。

正在加载回复...