This commit is contained in:
Charles 2001-06-20 14:21:09 +00:00
parent 3818c035ea
commit fec9759b75
3 changed files with 29 additions and 3 deletions

View File

@ -1,4 +1,5 @@
body1static
body2static
body3static
tailstatic
headsnap

View File

@ -302,6 +302,29 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames )
sinPos.vy += ( diff * rsin( headingToTarget + 1024 ) ) >> 12;
m_segmentArray[segmentCount].setPos( sinPos );
if ( segmentCount > 3 )
{
if ( segmentCount == m_segmentCount - 1 )
{
m_segmentArray[segmentCount].setAnim( ANIM_SEASNAKE_TAILSTATIC );
}
else
{
if ( segmentCount % 2 )
{
m_segmentArray[segmentCount].setAnim( ANIM_SEASNAKE_BODY2STATIC );
}
else
{
m_segmentArray[segmentCount].setAnim( ANIM_SEASNAKE_BODY3STATIC );
}
}
}
else
{
m_segmentArray[segmentCount].setAnim( ANIM_SEASNAKE_BODY1STATIC );
}
oldPos = sinPos;
for ( skipCounter = 0 ; skipCounter < NPC_SEA_SNAKE_SPACING ; skipCounter++ )
@ -591,7 +614,7 @@ void CNpcSeaSnakeSegment::render()
if ( renderFlag )
{
SprFrame = m_actorGfx->Render(renderPos,ANIM_SEASNAKE_BODY1STATIC,0,0);
SprFrame = m_actorGfx->Render(renderPos,m_anim,0,0);
m_actorGfx->RotateScale( SprFrame, renderPos, m_heading, 4096, m_scale );
sBBox boundingBox = m_actorGfx->GetBBox();

View File

@ -22,7 +22,7 @@ public:
virtual void render();
virtual void processEnemyCollision( CThing *thisThing );
virtual void setScale( u16 scale ) {m_scale = scale;}
CNpcSeaSnakeSegment *m_nextSegment;
CNpcSeaSnakeSegment *m_nextSegment;
virtual void setPos( DVECTOR newPos ) {Pos = newPos;}
virtual DVECTOR getPos() {return( Pos );}
virtual void setHeading( s16 newHeading ) {m_heading = newHeading;}
@ -33,10 +33,12 @@ public:
virtual CRECT const &getCollisionArea() {return m_collisionArea;}
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
int getCollisionRadius() {return m_collisionRadius;}
void setAnim( int newAnim ) {m_anim = newAnim;}
protected:
u16 m_scale;
CActorGfx *m_actorGfx;
int m_anim;
DVECTOR Pos;
s16 m_heading;
CRECT m_collisionArea;
@ -65,7 +67,7 @@ protected:
enum
{
NPC_SEA_SNAKE_SPACING = 4,
NPC_SEA_SNAKE_SPACING = 6,
NPC_SEA_SNAKE_LENGTH = 10,
};