forked from DUCKSOO/ToonHeroes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enemy.h
51 lines (42 loc) · 1.12 KB
/
Enemy.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "cocos2d.h"
#include "Object_Tower.h"
using namespace cocos2d;
class CEnemy :
public Sprite
{
public:
CEnemy();
~CEnemy();
public:
Sprite* m_pEnemySprite;
Object_Tower* m_pTargetTower;
Point m_pos;
float m_fMoveSpeed;
int m_iTag; //객체 태그
int m_iObjTag; //플레이어 인가? 적인가? 충돌체크 용
bool m_bLiveFlag;
int m_iHP;
int m_iState;
int m_iPrevState;
int m_iDirection;
int m_iFrame;
float m_fFrameDelay;
bool isAttack;
Point m_EnemyPos;
public:
void setHp(int EnemyHp) { m_iHP = EnemyHp; }
void setLiveFlag(bool EnemyLiveFlag) { m_bLiveFlag = EnemyLiveFlag; }
void setState(int State) { m_iState = State; }
public:
bool getLiveFlag() { return m_bLiveFlag; }
int getTag() { return m_iTag; }
Sprite* getEnemySprite() { return m_pEnemySprite; }
int getObjTag() { return m_iObjTag; }
int getState() { return m_iState; }
public:
virtual bool init(int _tag);
virtual void action(float _dt);
virtual void animation(float _dt);
virtual void setSpeed(float _speed) { m_fMoveSpeed = _speed; }
};