This commit is contained in:
parent
8fc2f0e1df
commit
12e8907ece
@ -18,4 +18,12 @@
|
||||
|
||||
void CNpc::processGaryMovement( int _frames )
|
||||
{
|
||||
if ( isCollisionWithGround() )
|
||||
{
|
||||
Pos.vx += _frames;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pos.vy += _frames;
|
||||
}
|
||||
}
|
@ -98,3 +98,9 @@ void CNpc::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY )
|
||||
*distX = playerPos.vx - this->Pos.vx;
|
||||
*distY = playerPos.vy - this->Pos.vy;
|
||||
}
|
||||
|
||||
bool CNpc::isCollisionWithGround()
|
||||
{
|
||||
ASSERT(m_layerCollision);
|
||||
return m_layerCollision->Get(Pos.vx>>4,Pos.vy>>4);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class CLayerCollision *CNpc::m_layerCollision;
|
||||
|
||||
void CNpc::init()
|
||||
{
|
||||
m_type = NPC_SKELETAL_FISH;
|
||||
m_type = NPC_GARY;
|
||||
|
||||
m_heading = m_fireHeading = 0;
|
||||
m_movementTimer = 0;
|
||||
|
@ -266,6 +266,7 @@ protected:
|
||||
void processCollision();
|
||||
void processTimer( int _frames );
|
||||
void detectCollisionWithPlayer();
|
||||
bool isCollisionWithGround();
|
||||
|
||||
void processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed );
|
||||
void processGenericGetUserDist( int _frames, s32 *distX, s32 *distY );
|
||||
|
Loading…
Reference in New Issue
Block a user