-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerObject.h
63 lines (51 loc) · 1.85 KB
/
PlayerObject.h
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
#ifndef __PlayerObject_h_
#define __PlayerObject_h_
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
# include <OIS/OISEvents.h>
# include <OIS/OISKeyboard.h>
#else
# include <OISEvents.h>
# include <OISKeyboard.h>
#endif
#include "GameObject.h"
#include "SoundPlayer.h"
#include "Paddle.h"
#include "Simulator.h"
#include <SdkTrays.h>
class GameScreen;
#define IFRAMES_ON_HIT 180
#define IFRAMES_ON_SPAWN 180
#define IFRAMES_ON_DEFEND 90 //TODO use to stop damage when hitting asteroids
#define FRAMES_PER_OOB_DAMAGE 90
#define OOB_DAMAGE 1
//---------------------------------------------------------------------------
class PlayerObject : public GameObject {
protected:
GameScreen* gameScreen;
Ogre::SceneNode* cameraNode;
Ogre::Light* light;
Ogre::Camera* cam;
OgreBites::ParamsPanel* mDetailsPanel;
SoundPlayer* soundPlayer;
int clientId;
int hp;
int iframes;
bool outOfBounds;
int outOfBoundsTimer;
Ogre::ParticleSystem* pSys;
public:
PlayerObject(Ogre::String nym, Ogre::SceneManager* mgr, Simulator* sim, GameScreen* gs, Ogre::SceneNode* cm, SoundPlayer* sPlayer, Ogre::Light* lt, int clId);
virtual ~PlayerObject();
virtual void addToSimulator(void);
virtual void update(void) = 0;
virtual void grabCamera() = 0;
virtual void setDeetsPan(OgreBites::ParamsPanel* mDeetsPan);
virtual void setHealth(int health);
virtual int getHealth();
virtual Ogre::ParticleSystem* getParticleSystem();
virtual void injectKeyDown(const OIS::KeyEvent &arg) = 0;
virtual void injectKeyUp(const OIS::KeyEvent &arg) = 0;
};
//---------------------------------------------------------------------------
#endif //#ifndef __PlayerObject_h
//---------------------------------------------------------------------------