From f033ab2d2e19452108f0a6ea99c589c6406c53c2 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 17 Jul 2001 20:30:13 +0000 Subject: [PATCH] --- source/hazard/hazard.h | 2 +- source/hazard/hcheck.cpp | 20 +++++++++++++++++++- source/hazard/hcheck.h | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/source/hazard/hazard.h b/source/hazard/hazard.h index c8cde9e8c..9538e2808 100644 --- a/source/hazard/hazard.h +++ b/source/hazard/hazard.h @@ -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 );} diff --git a/source/hazard/hcheck.cpp b/source/hazard/hcheck.cpp index 80a5a15f9..b73bf4917 100644 --- a/source/hazard/hcheck.cpp +++ b/source/hazard/hcheck.cpp @@ -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 ); } } } diff --git a/source/hazard/hcheck.h b/source/hazard/hcheck.h index 094465872..ca5fa8c38 100644 --- a/source/hazard/hcheck.h +++ b/source/hazard/hcheck.h @@ -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 \ No newline at end of file