-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfoothold.cpp
More file actions
45 lines (40 loc) · 830 Bytes
/
foothold.cpp
File metadata and controls
45 lines (40 loc) · 830 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
43
44
45
#include "stdafx.h"
#include "foothold.h"
HRESULT foothold::init()
{
_name = "foothold";
_image = IMAGEMANAGER->addFrameImage("foothold", L"images/object/foothold.png", 3, 1);
_isOn = false;
_isStepOn = false;
_count = 0;
return S_OK;
}
void foothold::release()
{
}
void foothold::update()
{
if (isCollision(_rc, OBJECTMANAGER->findObject(objectType::PLAYER, "player")->getRect()))
{
_isStepOn = true;
_count++;
// 만약 아이템을 못 먹었으면 아이템 먹는 처리
}
else
{
_isStepOn = false;
_count = 0;
}
}
void foothold::render()
{
if (_isOn)
{
if (_isStepOn)
_image->frameRender(CAMERA->getRelativeVector2(_rc.getCenter()), 2, 0);
else
_image->frameRender(CAMERA->getRelativeVector2(_rc.getCenter()), 1, 0);
}
else
_image->frameRender(CAMERA->getRelativeVector2(_rc.getCenter()), 0, 0);
}