This commit is contained in:
parent
d6f0f0f18e
commit
2fded56717
@ -50,7 +50,7 @@ s32 CNpc::playerXDist;
|
|||||||
s32 CNpc::playerYDist;
|
s32 CNpc::playerYDist;
|
||||||
s32 CNpc::playerXDistSqr;
|
s32 CNpc::playerXDistSqr;
|
||||||
s32 CNpc::playerYDistSqr;
|
s32 CNpc::playerYDistSqr;
|
||||||
|
class CLayerCollision *CNpc::m_layerCollision;
|
||||||
|
|
||||||
void CNpc::init()
|
void CNpc::init()
|
||||||
{
|
{
|
||||||
@ -72,6 +72,8 @@ void CNpc::init()
|
|||||||
|
|
||||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||||
|
|
||||||
|
m_layerCollision = NULL;
|
||||||
|
|
||||||
switch ( m_data[this->m_type].initFunc )
|
switch ( m_data[this->m_type].initFunc )
|
||||||
{
|
{
|
||||||
case NPC_INIT_DEFAULT:
|
case NPC_INIT_DEFAULT:
|
||||||
|
@ -81,6 +81,7 @@ public:
|
|||||||
void think(int _frames);
|
void think(int _frames);
|
||||||
virtual void render();
|
virtual void render();
|
||||||
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
||||||
|
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -363,6 +364,8 @@ protected:
|
|||||||
static s32 playerXDistSqr;
|
static s32 playerXDistSqr;
|
||||||
static s32 playerYDistSqr;
|
static s32 playerYDistSqr;
|
||||||
|
|
||||||
|
static class CLayerCollision *m_layerCollision;
|
||||||
|
|
||||||
// internal variables
|
// internal variables
|
||||||
|
|
||||||
NPC_UNIT_TYPE m_type;
|
NPC_UNIT_TYPE m_type;
|
||||||
|
@ -96,6 +96,7 @@ void CGameScene::init()
|
|||||||
C2dEnemy *enemy;
|
C2dEnemy *enemy;
|
||||||
enemy=new ("test enemy") C2dEnemy;
|
enemy=new ("test enemy") C2dEnemy;
|
||||||
enemy->init();
|
enemy->init();
|
||||||
|
enemy->setLayerCollision( Level.getCollisionLayer() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
createPlayer();
|
createPlayer();
|
||||||
|
Loading…
Reference in New Issue
Block a user