-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameObject.cpp
64 lines (50 loc) · 1.05 KB
/
GameObject.cpp
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
//GameObject.cpp
#include "GameObject.h"
//default constructor for GameObject
GameObject::GameObject(char in_code)
{
display_code = in_code;
state = 0;
location = Point2D(0.0, 0.0);
//cout << "Default GameObject constructed" << endl;
}
//Parameter constructor for GameObject
GameObject::GameObject(Point2D in_loc, int in_id, char in_code)
{
display_code = in_code;
id_num = in_id;
location = in_loc;
state = 0;
//cout << "GameObject constructed" << endl;
}
GameObject::~GameObject()
{
//cout << "GameObject Destructed" << endl;
}
//returns Point2D location for specific GameObject
Point2D GameObject::GetLocation()
{
return location;
}
//returns ID for specific GameObject
int GameObject::GetId()
{
return id_num;
}
//returns state of the state machine
char GameObject::GetState()
{
return state;
}
/*
//prints status of object
void GameObject::ShowStatus()
{
cout << "(" << display_code << ")(" << id_num << ") at " << location << endl;
}
*/
void GameObject::DrawSelf(char* ptr)
{
*ptr = display_code;
*(ptr + 1) = '0' + id_num;
}