-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.h
89 lines (73 loc) · 2.44 KB
/
entity.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
77
78
79
80
81
82
83
84
85
86
87
88
89
// -----------------------------------------------------------------
// Learning Team B
// Members:
// Adam LeMmon
// Faith Satterthwaite
// Tom Fletcher
// Justin Ball
// CS 4280 – 11:30 am
// Final Project
// Dr. Rague
// Due: 12/06/12
// Version: 2.4
// -----------------------------------------------------------------
// We made five major improvements to this game
// 1) New controls
// 2) Enemy attack
// 3) HUD (heads up display)
// 4) Enemy health bars
// 5) New Weapon
// -----------------------------------------------------------------
#ifndef __ENTITY_H
#define __ENTITY_H
/*
ENTITY.H
The CEntity class
Author: Kevin Hawkins
Date: 3/29/2001
Description: The CEntity class is derived from CMD2Model and
provides the functionality of an entity in the
game world. It holds the current MD2 animation
state, the entity angle heading, and the entity's
primary sound.
*/
#include <stdlib.h>
#include <time.h>
#include <typeinfo.h>
#include "md2.h"
#include "object.h"
#include "camera.h"
// Phase 15 - Comment out the following
// Phase 19 - Uncomment the following
#include "DirectXAudio.h"
#include "terrain.h"
class CEntity : public CMD2Model
{
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera);
void OnCollision(CObject *collisionObject);
void OnPrepare();
// Phase 15 - Comment out the following
// Phase 19 - Uncomment the following
void PlaySound()
{
audioSys->PlaySoundDX(index); //call the audioSys playSoundDX method with the index associated with this object
}
public:
float direction; // angle the entity is facing (in degrees)
// Phase 15 - Comment out the following
// Phase 19 - Uncomment the following
CDirectXAudio *audioSys; // a pointer to the audio system
XACTINDEX index; // used to hold the index of the sound associated with this index
CEntity();
~CEntity();
int stateStart, stateEnd; // state keyframe start/end
float deltaT;
float animSpeed;
// Phase 15 - Comment out the following
// Phase 19 - Uncomment the following
void LoadAudio(XACTINDEX index);
void SetAudioSystem(CDirectXAudio *asys) { audioSys = asys; }
};
#endif