?? over.cpp
字號:
#include"Over.h"
COver::COver()
{
overCount=0;
color=0;
backColor=15;
strcpy(GameOverStr,"GAMEOVER");
strcpy(pressEnter,"按Enter重新開始");
strcpy(pressEsc,"按Esc退出游戲");
}
COver::~COver()
{
}
GameState COver::Logic(bool goOn)
{
fflush( stdin );
if(_kbhit())
{
int a=_getch();
char input[2];
if(a<0)
{
input[0] = a;
input[1] = _getch();
}
else
{
input[1] = a;
}
switch (input[1])
{
case KEY_ENTER:
return GAME;
break;
case KEY_ESC:
return EXIT;
break;
}
}
overCount++;
if(overCount%3==0)
{
DrawText(8,9,(color)%7+9,GameOverStr);
DrawText(5,14,(color+1)%7+9,pressEnter);
DrawText(6,16,(color+2)%7+9,pressEsc);
color++;
if(color==1000)
{
color=0;
}
}
return OVER;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -