-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShipAI.h
76 lines (60 loc) · 1.59 KB
/
ShipAI.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
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __ShipAI_h_
#define __ShipAI_h_
#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
# include <OIS/OISEvents.h>
# include <OIS/OISKeyboard.h>
#else
# include <OISEvents.h>
# include <OISKeyboard.h>
#endif
#include "SoundPlayer.h"
#include <SdkTrays.h>
#include <btBulletDynamicsCommon.h>
#include <Ogre.h>
#include "BaseApplication.h"
#include "GameObject.h"
#include "Ship.h"
#include "AsteroidSys.h"
#include "Simulator.h"
#include "Paddle.h"
#include "Alien.h"
#define NUM_PRIORITIES 4
class GameScreen;
//---------------------------------------------------------------------------
class ShipAI: public Ship
{
public:
ShipAI(Ogre::String nym, Ogre::SceneManager* mgr, Simulator* sim, GameScreen* gs, Ogre::SceneNode* sn, int &sc, SoundPlayer* sPlayer, int ops);
~ShipAI(void);
void addToScene(void);
void update(void);
void roam(void);
void shoot(void);
void hunt(void);
void melee(void);
void flee(void);
void survivalCheck(void);
void incomingAst(void);
void opponentProximityCheck(void);
protected:
Ogre::SceneNode* sceneNode;
PlayerObject* target;
bool gameStarted;
float yT;
//both closest and alternate are saved and based on reasoning of other states, one of them becomes target
GameObject *closest;
GameObject *alternate;
int paces;
bool doneRoaming;
bool mustFlee;
bool doneFleeing;
bool roamState;
bool shootState;
bool huntState;
bool meleeState;
bool fleeState;
int numOpponents;
};
//---------------------------------------------------------------------------
#endif // #ifndef __ShipAI_h_
//---------------------------------------------------------------------------