-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworld.h
142 lines (119 loc) · 3.1 KB
/
world.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// -----------------------------------------------------------------
// 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 __WORLD_H
#define __WORLD_H
/*
WORLD.H
The CWorld class
Description: The CWorld class represents the game world
of the engine. All objects, the terrain,
audio system, ambient world music and sound,
and the camera are held here.
*/
// Begin - Phase 15
#include <typeinfo.h>
// End - Phase 15
// Begin - Phase 18
#include "gui.h"
// End - Phase 18
// Begin - Phase 14
#include "player.h"
// End - Phase 14
// Begin - Phase 15
#include "sod.h"
#include "ogro.h"
#include "entity.h"
#include "md2.h"
// End - Phase 15
#include "object.h"
#include "camera.h"
// Begin - Phase 12
#include "terrain.h"
// End - Phase 12
// Begin - Phase 19
#include "DirectXAudio.h"
// End - Phase 19
#include "tree.h"
// Begin - Phase 15
#define MAX_ENEMIES 10
// End - Phase 15
class CWorld
{
private:
// Begin - Phase 15
int numOgros, numSods;
// End - Phase 15
int screenWidth, screenHeight;
bool gameDone;
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera);
void OnPrepare();
public:
///// -- Adam
bool shift, w, s, a, d;
bool sprint;
///// -- Adam
HWND hwnd;
// Begin - Phase 12
CTerrain *terrain;
// End - Phase 12
CCamera *camera; // the camera
// Begin - Phase 14
CPlayer *player;
// End - Phase 14
// Begin - Phase 19
CDirectXAudio *audioSystem;
// End - Phase 19
// Begin - Phase 18
CGUI *gui;
// End - Phase 18
// Begin - Phase 15
COgroEnemy *ogroEnemy;
CSodEnemy *sodEnemy;
// End - Phase 15
float timeStart;
float timeElapsed;
CWorld();
CWorld(CCamera *c);
~CWorld();
// initialize terrain, load objects and put in container
void LoadWorld();
void UnloadWorld();
// Begin - Phase 15
int CountObjectTypes(const type_info &classID);
// End - Phase 15
// do physics calculations for all objects in the world
// including collisions
void Animate(float deltaTime);
// render all objects in the world
void Draw(CCamera *camera);
void Prepare() { OnPrepare(); }
void FadeScreen();
void SetScreen(int width, int height);
bool IsGameDone() { return gameDone; }
void QuitGame() { gameDone = true; }
// Begin - Phase 15
int GetOgros() { return numOgros; }
int GetSods() { return numSods; }
// End - Phase 15
};
#endif