📄 gamecontroler.h
字号:
// GameControler.h: interface for the GameControler class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GAMECONTROLER_H__24C993E2_9EE9_4912_B3CB_B3221EB5C57F__INCLUDED_)
#define AFX_GAMECONTROLER_H__24C993E2_9EE9_4912_B3CB_B3221EB5C57F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "bug.h"
enum GameLevel { Slow, Fast, Done };
enum GameStatus {GameWon, Playing, GameLost, SettingUp };
// Speed of game (i.e. timer interval)
const int GameSpeed = 100;
// Types of bugs, this should match the number of
// game levels (Slow + Fast = 2)
const int NumberOfBugTypes = 2;
class GameController {
public:
GameController(const string &Title = "Bug Hunt!",
const Position &WinPosition = Position(3.0, 3.0),
const float WindLength = 14.0,
const float WinHeight = 10.0);
~GameController();
SimpleWindow *GetWindow();
void Reset();
void Play(const GameLevel Level);
int MouseClick(const Position &MousePosition);
int TimerTick();
private:
void BugHit();
GameLevel CurrentLevel() const;
Bug *CurrentBug() const;
SimpleWindow *GameWindow;
GameLevel Level;
GameStatus Status;
vector<Bug*> KindOfBug;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -