-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharlesE.h
115 lines (105 loc) · 2.13 KB
/
charlesE.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
// Charles Enright
// CS 335 Software Engineering
// File includes header portion of AI and elements of game mechanics.
#ifndef _mob_h_
#define _mob_h_
#ifndef _VEC_H_
#include "vec.h"
#endif
#ifndef _VIEW_H_
#include "view.h"
#endif
#ifndef _INPUT_H_
//#include "input.h"
#endif
#ifndef _SOLIDSPHERE_H_
#include "solidSphere.h"
#endif
#ifndef _GAME_H_
// #include <cstdlib>
#endif
#ifndef OPENAL_H
// #include <unistd>
#endif
#ifndef _MAP_h
#include "map.h"
#endif
float r(float, float);
Vec MakeVector(float, float, float);
class Game;
class View;
void respawn_mobs(Game*, int);
void chadKey(Game* g, View* v);
void startAstar(Game* g);
bool mapToggle(int t);
bool dinoToggle(int t);
double celsiusToFahrenheit(double);
double fahrToCels(double);
class Mob
{
protected:
int id;
int moved;
unsigned int texture;
unsigned int shotTick;
float hp;
Vec location;
Vec velocity;
Vec maxSpeed;
public:
solidSphere body;
Vec lastFace;
bool hasMap;
int dino;
Map* map2d;
Mob();
Mob(int, Vec*);
void spawn(Vec*);
void death(Game*);
void damage(int, Game*);
void move();
virtual void render();
//void render(Game*);
void move(Game*);
virtual int Collide(Vec*);
Vec* getLoc() { return &location; }
Vec* getVel() { return &velocity; }
void setLocY(float y = 1);
void setVelY(float y = 0);
void setTick(unsigned int tic = 0) { this->shotTick = tic; }
unsigned int getTick() { return this->shotTick; }
void incTick() { this->shotTick++; }
unsigned int getTex() { return texture; }
void setTex(unsigned int t);
bool operator==(int b);
bool operator==(Mob* b);
virtual ~Mob();
};
/*
class Enemy: public Mob
{
void render();
void move();
};*/
class cWall: public Mob
{
private:
Vec start;
Vec end;
float height;
float width;
Vec corners[8];
Vec endpoints[2];
Vec color;
public:
cWall();
cWall(int, Vec*);
cWall(Vec, Vec, float, float);
void Set(Vec, Vec, float, float);
void Draw();
int Collide(Vec*, float);
};
class Npc: public Mob
{
};
#endif