-
Notifications
You must be signed in to change notification settings - Fork 2
/
SmileBoy.h
33 lines (31 loc) · 860 Bytes
/
SmileBoy.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
#include "Skeleton.h"
class SmileBoy : public Skeleton
{
public:
void Init()
{
LoadSkeleton("skeleton/boy/", "boy.md5mesh");
LoadAnimation("skeleton/boy/", "boy.md5anim");
SetScale(0.05);
SetPosition(0, 0, -4);
}
void HandleInput(Input *input)
{
if(input->IsPressed('w') == TRUE || input->IsPressed('W') == TRUE)
{
SetPosition(x, y, z+0.2);
}
else if(input->IsPressed('s') == TRUE || input->IsPressed('S') == TRUE)
{
SetPosition(x, y, z-0.2);
}
else if(input->IsPressed('a') == TRUE || input->IsPressed('A') == TRUE)
{
SetPosition(x-0.2, y, z);
}
else if(input->IsPressed('d') == TRUE || input->IsPressed('D') == TRUE)
{
SetPosition(x+0.2, y, z+0.05);
}
}
};