This commit is contained in:
Daveo 2001-06-18 14:22:37 +00:00
parent 913de40b7d
commit 338c9793d8
2 changed files with 69 additions and 0 deletions

48
source/fx/fxlaser.cpp Normal file
View File

@ -0,0 +1,48 @@
/*****************/
/*** Thwack!!! ***/
/*****************/
#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 "gfx\otpos.h"
#include "FX\FXThwack.h"
const int ThwackLife=12;
/*****************************************************************************/
void CFXThwack::init(DVECTOR const &_Pos)
{
CFX::init(_Pos);
Life=ThwackLife;
OtPos=OTPOS__ACTOR_POS-1;
Angle=getRnd()&4095;
Scale=2048+1024+(getRnd()&2047);
}
/*****************************************************************************/
/*** Render ******************************************************************/
/*****************************************************************************/
void CFXThwack::render()
{
DVECTOR RenderPos;
getFXRenderPos(RenderPos);
if (!canRender() || !IsVisible) return;
SpriteBank *SprBank=CGameScene::getSpriteBank();
POLY_FT4 *Ft4=SprBank->printRotatedScaledSprite(FRM__THWACK,RenderPos.vx,RenderPos.vy,Scale,Scale,Angle,OtPos);
setSemiTrans(Ft4,1);
Ft4->tpage|=1<<5;
int Col=(256/ThwackLife)*Life;
setRGB0(Ft4,Col,Col,Col);
}

21
source/fx/fxlaser.h Normal file
View File

@ -0,0 +1,21 @@
/*****************/
/*** Thwack!!! ***/
/*****************/
#ifndef __FX_FX_THWACK_HEADER__
#define __FX_FX_THWACK_HEADER__
#include "fx/fx.h"
/*****************************************************************************/
class CFXThwack : public CFX
{
public:
virtual void init(DVECTOR const &Pos);
virtual void render();
protected:
u16 Angle,Scale;
};
#endif