This commit is contained in:
Charles 2001-07-17 20:30:13 +00:00
parent 2aa8982ea5
commit f033ab2d2e
3 changed files with 23 additions and 2 deletions

View File

@ -76,7 +76,7 @@ public:
virtual void init();
virtual void setGraphic( sThingHazard *ThisHazard );
void shutdown();
void think(int _frames);
virtual void think(int _frames);
virtual void render();
virtual void setWaypoints( sThingHazard *ThisHazard );
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}

View File

@ -36,6 +36,22 @@ void CNpcCheckpointHazard::init()
m_triggered = false;
m_spriteFrame = FRM__CHECKPOINT;
m_timer = 0;
m_flick = false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcCheckpointHazard::think(int _frames)
{
m_timer -= _frames;
if ( m_timer <= 0 )
{
m_flick = !m_flick;
m_timer = GameState::getOneSecondInFrames();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -43,6 +59,7 @@ void CNpcCheckpointHazard::init()
void CNpcCheckpointHazard::render()
{
sFrameHdr *frameHdr;
POLY_FT4 *Ft4;
if ( m_isActive )
{
@ -67,7 +84,8 @@ void CNpcCheckpointHazard::render()
y = Pos.vy - 100 - offset.vy - ( spriteHeight >> 1 );
frameHdr = CGameScene::getSpriteBank()->getFrameHeader( m_spriteFrame );
CGameScene::getSpriteBank()->printFT4( frameHdr, x, y, 0, 0, 10 );
Ft4 = CGameScene::getSpriteBank()->printFT4( frameHdr, x, y, 0, 0, 10 );
setSemiTrans( Ft4, m_flick );
}
}
}

View File

@ -23,11 +23,14 @@ class CNpcCheckpointHazard : public CNpcHazard
public:
void init();
void render();
void think(int _frames);
protected:
void collidedWith(CThing *_thisThing);
u8 m_triggered;
int m_spriteFrame;
int m_timer;
u8 m_flick;
};
#endif