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