SBSPSS/source/fx/fxbubble.cpp

62 lines
1.3 KiB
C++
Raw Normal View History

2001-06-01 17:10:05 +02:00
/*****************/
/*** Bubble FX ***/
/*****************/
2001-06-01 16:05:21 +02:00
#include "system\global.h"
#include <DStructs.h>
#include "utils\utils.h"
#include "gfx\prim.h"
#include "gfx\sprbank.h"
#include <sprites.h>
#include "level\level.h"
#include "game\game.h"
#include "level\layercollision.h"
#include "FX\FXBaseAnim.h"
2001-06-01 17:10:05 +02:00
#include "FX\FXBubble.h"
2001-06-01 16:05:21 +02:00
/*****************************************************************************/
2001-06-01 17:10:05 +02:00
void CFXBubble::init(DVECTOR const &_Pos)
2001-06-01 16:05:21 +02:00
{
2001-06-01 17:10:05 +02:00
CFXBaseAnim::init(_Pos);
Life=32+getRndRange(63);
VelY=-getRndRange(4)-1;
2001-06-04 21:01:17 +02:00
CurrentScaleX=CurrentScaleY=getRndRange(DataPtr->Scale/2)+(DataPtr->Scale/2);
2001-06-01 17:10:05 +02:00
Die=0;
XIdx=getRnd()&15;
2001-06-01 16:05:21 +02:00
}
/*****************************************************************************/
/*** Think *******************************************************************/
/*****************************************************************************/
2001-06-01 17:10:05 +02:00
int XT[16]={ 0,+1,+0,+1,+0, 0,-1,+0,-1,+0,0,+1,+0,+1,+0,};
void CFXBubble::think(int _frames)
2001-06-01 16:05:21 +02:00
{
2001-06-01 17:10:05 +02:00
if (Die)
2001-06-01 16:05:21 +02:00
{
2001-06-01 17:10:05 +02:00
if (renderFrame!=FRM__BUBBLEPOP)
2001-06-01 16:05:21 +02:00
{
2001-06-01 17:10:05 +02:00
renderFrame=FRM__BUBBLEPOP;
}
else
{
setToShutdown();
2001-06-01 16:05:21 +02:00
}
}
2001-06-01 17:10:05 +02:00
else
{
CFXBaseAnim::think(_frames);
Pos.vx+=XT[XIdx++];
XIdx&=15;
}
2001-06-01 16:05:21 +02:00
}
/*****************************************************************************/
2001-06-01 17:10:05 +02:00
void CFXBubble::killFX()
2001-06-01 16:05:21 +02:00
{
2001-06-01 17:10:05 +02:00
Die=1;
2001-06-01 16:05:21 +02:00
}
2001-06-01 17:10:05 +02:00