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

📄 help.cpp

📁 一个控制台VC++2005版的俄罗斯方块源码
💻 CPP
字号:
#include"Help.h"

CHelp::CHelp()
{
	//↑↓→←
	
	backColor=15;//黑底白字
	charColor=10;//绿色
	buttonColor=240;//白底黑字
	strcpy(help[0],"上(变形):");
	strcpy(help[1],"下:");
	strcpy(help[2],"左:");
	strcpy(help[3],"右:");
	strcpy(help[4],"到底:");
	strcpy(help[5],"按Enter返回");
	strcpy(button[0],"↑");
	strcpy(button[1],"↓");
	strcpy(button[2],"←");
	strcpy(button[3],"→");
	strcpy(button[4],"W");
	strcpy(button[5],"S");
	strcpy(button[6],"A");
	strcpy(button[7],"D");
	strcpy(button[8],"space");
	ClearBuffer(2,1,20,20,backColor);
	for(int i=0;i<5;i++)
	{	
		DrawText( 7-strlen(help[i])/2, 4+i*2, charColor,help[i] );
	}
	for(int i=0;i<4;i++)
	{	
		DrawText( 14, 4+i*2, buttonColor,button[i]);
		DrawText( 14+3, 4+i*2, buttonColor,button[i+4]);
	}
	DrawText( 14, 12, buttonColor,button[8]);
	DrawText( 5, 16, charColor,help[5] );
}

CHelp::~CHelp()
{
}

GameState CHelp::Logic(bool goOn)
{
	fflush( stdin );
	if(_kbhit())
	{
		int key=_getch();
		if(key<0)
		{
			key=_getch();
		}
		if(key==KEY_ENTER)
		{
			return MENU;
		}
	}
	return HELP;
}

⌨️ 快捷键说明

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