-
Notifications
You must be signed in to change notification settings - Fork 0
/
MobileDefender.h
41 lines (30 loc) · 965 Bytes
/
MobileDefender.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
#pragma once
#include "GameObject.h"
#include "EnemyObject.h"
#include "TowerObject.h"
#include "Node.h"
class MobileDefender : public TowerObject
{
public:
MobileDefender(glm::vec3 &entityPos, GLuint entityTexture, GLint entityNumElements, GLuint bulletTex);
~MobileDefender();
// Update function for moving the player object around
virtual void update(float deltaTime, GameObject* target) override;
virtual void render(Shader &shader) override;
void setPath(std::vector<Node*> p);
void nextNode();
inline Node* getCurrNode() { return currNode; }
inline bool getFinished() { return finished; }
inline virtual std::string getType() { return "mobile"; }
protected:
// current path to follow
std::vector<Node*> path;
// current "target" node we are heading towards
Node * currNode;
glm::vec3 velocity;
// if we have finished traversing our current path
bool finished;
float moveOrientation;
float range;
float a_max;
};