-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMiniGoomba.cpp
60 lines (40 loc) · 1.01 KB
/
MiniGoomba.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
#include "MiniGoomba.h"
CMiniGoomba::CMiniGoomba(float x, float y, int nx) {
this->x = x;
this->y = y;
this->nx = nx;
this->isDisable = true;
owner = NULL;
}
void CMiniGoomba::PrepareForShooting() {
vy = 0.14;
}
void CMiniGoomba::UpdatePos(Vector2 pos, int nx) {
this->x = pos.x;
this->y = pos.y + 0;
this->nx = nx;
}
void CMiniGoomba::CollidedLeftRight(LPGAMEOBJECT obj) {
CGameObject::CollidedLeftRight(obj);
}
void CMiniGoomba::CollidedTop(LPGAMEOBJECT obj) {
CGameObject::CollidedTop(obj);
}
void CMiniGoomba::Update(DWORD dt, vector<LPGAMEOBJECT>* coObjects) {
if (isDisable) return;
vx = 0.0f;
vy = 0.3f;
CGameObject::Update(dt, coObjects);
UpdateWithCollision(coObjects);
}
void CMiniGoomba::GetBoundingBox(float& left, float& top, float& right, float& bottom)
{
left = x - 20 / 2;
top = y - 20 / 2;
right = x + 20 / 2;
bottom = y + 20 / 2;
}
void CMiniGoomba::Render(Vector2 finalPos) {
CAnimations::GetInstance()->Get("ani-tiny-goomba-fall")
->Render(finalPos, Vector2(1, 1), 255);
}