-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMissile.h
43 lines (31 loc) · 1014 Bytes
/
Missile.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
// Module: Gameplay Programming
// Assignment 1: Pixl
#ifndef _MISSILE_H_
#define _MISSILE_H_
#include "entity.h"
namespace missileNS {
const int WIDTH = 128;
const int HEIGHT = 32;
const float ROTATION_RATE = PI / 4;
const int TEXTURE_COLS = 2;
const int MISSILE_START_FRAME = 0;
const int MISSILE_END_FRAME = 3;
const float SPEED = 100;
const float MASS = 100.0f;
const float SCALING = 0.25f;
const float ANIMATION_DELAY = 0.1f;
const bool LOOP = true;
const ObjectType OBJECT_TYPE = OBJECT_TYPE_MISSILE;
}
class Missile : public Entity {
public:
Missile();
virtual void draw();
virtual bool initialize(Game *gamePtr, int width, int height, int ncols, TextureManager *textureM);
void update(float deltaTime);
Entity* getTarget() { return this->target; } // return the targeted object
void setTarget(Entity* target) { this->target = target; } // set the target object to be followed by missile
private:
Entity* target;
};
#endif