This commit is contained in:
Charles 2001-02-12 17:52:04 +00:00
parent 8fc2f0e1df
commit 12e8907ece
4 changed files with 16 additions and 1 deletions

View File

@ -18,4 +18,12 @@
void CNpc::processGaryMovement( int _frames ) void CNpc::processGaryMovement( int _frames )
{ {
if ( isCollisionWithGround() )
{
Pos.vx += _frames;
}
else
{
Pos.vy += _frames;
}
} }

View File

@ -98,3 +98,9 @@ void CNpc::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY )
*distX = playerPos.vx - this->Pos.vx; *distX = playerPos.vx - this->Pos.vx;
*distY = playerPos.vy - this->Pos.vy; *distY = playerPos.vy - this->Pos.vy;
} }
bool CNpc::isCollisionWithGround()
{
ASSERT(m_layerCollision);
return m_layerCollision->Get(Pos.vx>>4,Pos.vy>>4);
}

View File

@ -54,7 +54,7 @@ class CLayerCollision *CNpc::m_layerCollision;
void CNpc::init() void CNpc::init()
{ {
m_type = NPC_SKELETAL_FISH; m_type = NPC_GARY;
m_heading = m_fireHeading = 0; m_heading = m_fireHeading = 0;
m_movementTimer = 0; m_movementTimer = 0;

View File

@ -266,6 +266,7 @@ protected:
void processCollision(); void processCollision();
void processTimer( int _frames ); void processTimer( int _frames );
void detectCollisionWithPlayer(); void detectCollisionWithPlayer();
bool isCollisionWithGround();
void processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed ); void processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed );
void processGenericGetUserDist( int _frames, s32 *distX, s32 *distY ); void processGenericGetUserDist( int _frames, s32 *distX, s32 *distY );