📄 control.h
字号:
// control.h : Interface of class GameControl
#ifndef BWINDOW_H
#define BWINDOW_H
#include "Bug.h"
#include "Hunter.h"
enum GameLevel { Slow, Fast, Done };
enum GameStatus { GameWon, Playing, GameLost, SettingUp };
const int GameSpeed = 100; // speed of game
const int DirectBmp = 4;
//------------------------------------------------------------------
class GameController
{
public:
// constructor
GameController( const string &Title = " ", const Position &WinPosition = Position(1.0, 1.0 ),
const float WindLength = 17.0, const float WinHeight = 13.0 );
// destructor
~GameController();
SimpleWindow* GetGameWindow(); // a pointer to the SimpleWindow for the Game
SimpleWindow* GetControlWindow(); // a pointer to the SimpleWindow for the Control
void Reset(); // put the game back in its initial state
void Play( const GameLevel Level ); // start the game
int MouseClick( const Position &MousePosition ); // mouse event for control window
int TimerTick(); // Timer event for game window
private:
void BugHit(); // whether the hunter hit the bug
GameLevel BugLevel() const; // the current level of the game
Bug* CurrentBug() const;
void InitBitMap();
SimpleWindow* GameWindow;
SimpleWindow* ControlWindow;
Hunter* m_Hunter;
vector<Bug*> KingOfBug;
vector<BitMap> m_vbDirectBmp;
GameLevel Level;
GameStatus Status;
};
#endif
//-------------------------------------------------------
// end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -