-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObject.cpp
More file actions
42 lines (41 loc) · 733 Bytes
/
Copy pathGameObject.cpp
File metadata and controls
42 lines (41 loc) · 733 Bytes
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
#include "GameObject.h"
GameObject::GameObject(char in_code)
{
display_code = in_code;
id_num = 1;
state = 0;
cout << "GameObject Created" << endl;
}
GameObject::~GameObject()
{
cout << "Game Object destroyed" << endl;
}
GameObject::GameObject(Point2D in_loc, int in_id, char in_code)
{
location = in_loc;
display_code = in_code;
id_num = in_id;
state = 0;
cout << "GameObject Created" << endl;
}
Point2D GameObject::GetLocation()
{
return location;
}
int GameObject::GetId()
{
return id_num;
}
int GameObject::GetState()
{
return state;
}
void GameObject::DrawSelf(char* ptr)
{
*ptr = display_code;
*(ptr + 1) = '0' + id_num;
}
void GameObject::ShowStatus()
{
cout << display_code << id_num << " at " << location;
}