-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.h
More file actions
65 lines (54 loc) · 1.9 KB
/
Game.h
File metadata and controls
65 lines (54 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef __Game_h_
#define __Game_h_
#include <chrono>
#include "BaseApplication.h"
#include "GameScreen.h"
#include "SoundPlayer.h"
#include <CEGUI/CEGUI.h>
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#include "NetManager.h"
#include "Packet.h"
//---------------------------------------------------------------------------
enum ShipType {ALIEN_SHIP, PADDLE_SHIP};
//---------------------------------------------------------------------------
class Game : public BaseApplication
{
public:
Game(char *hostIP = NULL);
virtual ~Game(void);
protected:
virtual bool configure(void);
virtual void createScene(void);
virtual void createFrameListener(void);
virtual void createCamera(void);
virtual void createViewports(void);
virtual void destroyScene(void);
virtual bool frameRenderingQueued(const Ogre::FrameEvent &evt);
virtual bool keyPressed(const OIS::KeyEvent &arg);
virtual bool keyReleased(const OIS::KeyEvent &arg);
virtual bool mouseMoved(const OIS::MouseEvent &arg);
virtual bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
virtual bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
virtual bool startSinglePlayer(const CEGUI::EventArgs &e);
virtual void setUpSDL(void);
virtual bool startHosting(const CEGUI::EventArgs &e);
virtual bool joinGame(const CEGUI::EventArgs &e);
CEGUI::OgreRenderer* mRenderer;
CEGUI::Window *guiRoot;
GameScreen *gameScreen;
Ogre::SceneNode *mCameraNode;
SoundPlayer *soundPlayer;
NetManager *netMgr;
bool gameStarted;
bool isServer;
bool singlePlayer;
char *host;
bool test;
Ogre::Light* shipLight;
Ogre::Light* alienLight;
ShipType shipType;
std::chrono::time_point<std::chrono::steady_clock> lastNetUpdate;
};
//---------------------------------------------------------------------------
#endif // #ifndef __Game_h_
//---------------------------------------------------------------------------