SBSPSS/source/fx/fxbubble.cpp

60 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);
2001-06-19 23:19:01 +02:00
Velocity.vy=-(getRndRange(4)+1);
CurrentScaleX=CurrentScaleY=getRndRange(ONE/2)+(ONE/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