This commit is contained in:
Charles 2001-04-26 15:20:21 +00:00
parent 2898ccb84c
commit 891103611f
12 changed files with 79 additions and 4 deletions

View file

@ -293,3 +293,29 @@ void CNpcSpiderCrabEnemy::processMovement(int _frames)
processMovementModifier( _frames, moveX, moveY, moveVel, moveDist );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSpiderCrabEnemy::processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange )
{
Pos.vx += distX;
Pos.vy += distY;
// sort out draw rotation
DVECTOR testPos1, testPos2;
testPos1 = testPos2 = Pos;
testPos1.vx -= 10;
testPos2.vx += 10;
testPos1.vy += m_layerCollision->getHeightFromGround( testPos1.vx, testPos1.vy, 16 );
testPos2.vy += m_layerCollision->getHeightFromGround( testPos1.vx, testPos1.vy, 16 );
s32 xDist = testPos2.vx - testPos1.vx;
s32 yDist = testPos2.vy - testPos1.vy;
s16 heading = ratan2( yDist, xDist );
m_drawRotation = heading;
}