⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 在控制台界面实现游戏控制
💻 CPP
字号:
#include<iostream.h>
#include"lsj.h"
#include<ctime>
#include "stdlib.h"
#include <Windows.h>
#include<Mmsystem.h> 


#include <stdio.h>


void face()
{
	
	 

		
	

	cout<<endl<<endl<<endl<<endl<<endl
		<<" \t\t游戏说明如下:\n"
		<<"	\t本游戏属于射击类游戏。\n"
		<<"	\t操纵键只有 上  下 左 右 四个键。\n"
		<<"	\t上方向射击键,左右键控制方向,下方向给坦克车装换炮弹键。\n"
		<<"	\t游戏规则:只有与障碍物相同的炮弹,才能打下相同的障碍物,否者无效.\n"
		<<"	\t最后计时,代表优良。\n\n"
		<<"	\tCome On Bady, It`s time for your big show!!!"<<endl;

	Sleep(6000);
}

void  main()
{
	

	int flag=0;


	
	while(1)
	{

		::sndPlaySound("jd.WAV",SND_ASYNC|SND_LOOP);
		if(flag==0)
		face();
		flag=1;
		time_t now_time,a1;
		now_time=time(0);
	Face okk;
	okk.set();
	okk.spread();
	::sndPlaySound("gz.WAV",SND_ASYNC);
		a1= time(0);
		a1-=now_time;

				

			system("cls");
				cout<<"\n\n\n\n\n";
			if(a1<=80)
			cout<<"            ★★       ★★\n"
				  "         ★        ★        ★\n"	
				  "         ★中国万岁共产党万岁★\n"
				  "         ★                  ★\n"
				  "          ★                ★\n"
				  "           ★   你太牛了!  ★\n"
				  "             ★          ★\n"
				  "               ★      ★\n"
				  "                  ★ ★\n"<<endl<<"\t\t耗时:"<<a1<<"秒"<<endl;
			else
				if(a1<=120)
		    cout<<"            ★★       ★★\n"
				  "         ★        ★        ★\n"	
				  "         ★中国万岁共产党万岁★\n"
				  "         ★                  ★\n"
				  "          ★                ★\n"
				  "           ★   你一般般了 ★\n"
				  "             ★          ★\n"
				  "               ★      ★\n"
				  "                  ★ ★\n"<<endl<<"\t\t耗时:"<<a1<<"秒"<<endl;
				else
	        cout<<"            ★★       ★★\n"
				  "         ★        ★        ★\n"	
				  "         ★中国万岁共产党万岁★\n"
				  "         ★                  ★\n"
				  "          ★                ★\n"
				  "           ★   你太失败了 ★\n"
				  "             ★          ★\n"
				  "               ★      ★\n"
				  "                  ★ ★\n"<<endl
				  <<"\t\t耗时:"<<a1<<"秒"<<endl;
											
									
				system("pause");				
		}						
				
		
		

		
		
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -