From b8f2d4671a7a9d9734c719a4f0f0c1dd674cb655 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 3 Jul 2001 16:35:22 +0000 Subject: [PATCH] --- source/fx/fxbubble.cpp | 10 ++++++++++ source/fx/fxbubble.h | 1 + 2 files changed, 11 insertions(+) diff --git a/source/fx/fxbubble.cpp b/source/fx/fxbubble.cpp index 7cc68ef74..166afac78 100644 --- a/source/fx/fxbubble.cpp +++ b/source/fx/fxbubble.cpp @@ -24,6 +24,7 @@ void CFXBubble::init(DVECTOR const &_Pos) CurrentScaleX=CurrentScaleY=getRndRange(ONE/2)+(ONE/2); Die=0; XIdx=getRnd()&15; + Lifetime = 2 * GameState::getOneSecondInFrames(); } /*****************************************************************************/ @@ -32,6 +33,15 @@ void CFXBubble::init(DVECTOR const &_Pos) int XT[16]={ 0,+1,+0,+1,+0, 0,-1,+0,-1,+0,0,+1,+0,+1,+0,}; void CFXBubble::think(int _frames) { + if (Lifetime > 0) + { + Lifetime -= _frames; + } + else + { + Die = true; + } + if (Die) { if (renderFrame!=FRM__BUBBLEPOP) diff --git a/source/fx/fxbubble.h b/source/fx/fxbubble.h index 8b51a7301..cb1bd5afa 100644 --- a/source/fx/fxbubble.h +++ b/source/fx/fxbubble.h @@ -18,6 +18,7 @@ virtual void killFX(); protected: s8 Die; u16 XIdx; + s32 Lifetime; }; #endif