diff --git a/source/enemy/nbuttfly.cpp b/source/enemy/nbuttfly.cpp index 99ab4dfa7..90906b863 100644 --- a/source/enemy/nbuttfly.cpp +++ b/source/enemy/nbuttfly.cpp @@ -30,10 +30,9 @@ void CNpcButterflyBackgroundEnemy::processMovementModifier(int _frames, s32 dist Pos.vx += distX; Pos.vy += distY; - m_frame++; - - if ( m_frame > ( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 ) ) + if ( !m_animPlaying ) { + m_animPlaying = true; m_frame = 0; } } @@ -73,7 +72,7 @@ void CNpcButterflyBackgroundEnemy::render() { if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) { - SprFrame = m_spriteBank->printRotatedScaledSprite( FRM_BUTTERFLY_FLAP01 + m_frame,renderPos.vx,renderPos.vy,4096,4096,0,10); + SprFrame = m_spriteBank->printFT4(FRM_BUTTERFLY_FLAP01 + ( m_frame >> 8 ),renderPos.vx,renderPos.vy,!m_reversed,0,10); setRGB0( SprFrame, 255, 128, 255 ); // Let me know if these change! ALso ket me know when the different coloured ones go in pls! (pkg) // get xmax, xmin, ymax, ymin diff --git a/source/enemy/nbuttfly.h b/source/enemy/nbuttfly.h index 0027fd26e..fb5bee38f 100644 --- a/source/enemy/nbuttfly.h +++ b/source/enemy/nbuttfly.h @@ -18,10 +18,15 @@ #include "enemy\nsjback.h" #endif +#ifndef __SPR_SPRITES_H__ +#include +#endif + class CNpcButterflyBackgroundEnemy : public CNpcSmallJellyfishBackgroundEnemy { public: virtual void render(); + virtual int getFrameCount() {return( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 + 1 );} protected: virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); };