This commit is contained in:
parent
2f7d86bd76
commit
8364b41cd1
@ -39,6 +39,8 @@ void CNpcDustDevilEnemy::processMovement( int _frames )
|
||||
|
||||
s32 moveX = 0;
|
||||
s32 moveY = 0;
|
||||
s32 moveVel = 0;
|
||||
s32 moveDist = 0;
|
||||
|
||||
bool pathComplete;
|
||||
|
||||
@ -117,6 +119,29 @@ void CNpcDustDevilEnemy::processMovement( int _frames )
|
||||
}
|
||||
}
|
||||
|
||||
Pos.vx += moveX;
|
||||
Pos.vy += moveY;
|
||||
processMovementModifier( _frames, moveX, moveY, moveVel, moveDist );
|
||||
}
|
||||
|
||||
void CNpcDustDevilEnemy::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;
|
||||
}
|
@ -20,6 +20,7 @@ public:
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user