This commit is contained in:
Daveo 2001-06-12 20:20:52 +00:00
parent a8f6989d13
commit 8f6f2a90be
7 changed files with 41 additions and 37 deletions

BIN
Graphics/sfx/+thwack.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -169,6 +169,7 @@ fx_src := fx \
fxbaseemitter \ fxbaseemitter \
fxattachanim \ fxattachanim \
fxbubble \ fxbubble \
fxthwack \
fxnrgbar \ fxnrgbar \
fxjfish \ fxjfish \
fxfallingtile \ fxfallingtile \

View file

@ -160,12 +160,10 @@ SFX_GFX_DIR := $(GRAF_DIR)/sfx
SFX_GFX := +smoke.bmp \ SFX_GFX := +smoke.bmp \
+explosion0001.bmp +explosion0002.bmp +explosion0003.bmp +explosion0004.bmp +explosion0005.bmp +explosion0006.bmp +explosion0007.bmp \ +explosion0001.bmp +explosion0002.bmp +explosion0003.bmp +explosion0004.bmp +explosion0005.bmp +explosion0006.bmp +explosion0007.bmp \
+splash001.bmp +splash002.bmp +splash003.bmp +splash004.bmp +splash005.bmp +splash006.bmp \ +splash001.bmp +splash002.bmp +splash003.bmp +splash004.bmp +splash005.bmp +splash006.bmp \
+Star0001.bmp +Star0002.bmp +Star0003.bmp \
+Star20001.bmp +Star20002.bmp +Star20003.bmp \
+fire01.bmp +fire02.bmp +fire03.bmp +fire04.bmp +fire05.bmp +fire06.bmp \ +fire01.bmp +fire02.bmp +fire03.bmp +fire04.bmp +fire05.bmp +fire06.bmp \
+drip.bmp +bubblepop.bmp \ +drip.bmp +bubblepop.bmp \
+Gush000.bmp +Gush001.bmp +Gush002.bmp \ +Gush000.bmp +Gush001.bmp +Gush002.bmp \
+leg.bmp +leg.bmp +thwack.bmp
SFX_GFX_IN := $(foreach FILE,$(SFX_GFX),$(SFX_GFX_DIR)/$(FILE)) SFX_GFX_IN := $(foreach FILE,$(SFX_GFX),$(SFX_GFX_DIR)/$(FILE))

View file

@ -19,6 +19,7 @@
#include "FX\FXAttachAnim.h" #include "FX\FXAttachAnim.h"
#include "FX\FXThwack.h"
#include "FX\FXBubble.h" #include "FX\FXBubble.h"
#include "FX\FXfallingTile.h" #include "FX\FXfallingTile.h"
#include "FX\FXSteam.h" #include "FX\FXSteam.h"
@ -241,11 +242,11 @@ void TestFX(DVECTOR Pos)
} }
*/ */
/*****************************************************************************/ /*****************************************************************************/
int FXType=(CFX::FX_TYPE)CFX::FX_TYPE_FOUNTAIN_WATER; int FXType=(CFX::FX_TYPE)CFX::FX_TYPE_THWACK;
void TestFX(DVECTOR Pos,CThing *Parent) void TestFX(DVECTOR Pos,CThing *Parent)
{ {
CFXAttachAnim *FX=(CFXAttachAnim*)CFX::Create((CFX::FX_TYPE)FXType,Pos); CFXAttachAnim *FX=(CFXAttachAnim*)CFX::Create((CFX::FX_TYPE)FXType,Pos);
Parent->addChild(FX); // Parent->addChild(FX);
// TestFXPtr->setLife(32); // TestFXPtr->setLife(32);
} }
@ -340,6 +341,10 @@ CFX *NewFX;
NewFX->setData(&FXOilFountainData); NewFX->setData(&FXOilFountainData);
break; break;
case FX_TYPE_THWACK:
NewFX=new ("FXThwack") CFXThwack();
break;
case FX_TYPE_NRG_BAR: case FX_TYPE_NRG_BAR:
NewFX=new ("NRG Bar") CFXNRGBar(); NewFX=new ("NRG Bar") CFXNRGBar();
break; break;

View file

@ -38,6 +38,8 @@ public:
FX_TYPE_FOUNTAIN_LAVA, FX_TYPE_FOUNTAIN_LAVA,
FX_TYPE_FOUNTAIN_OIL, FX_TYPE_FOUNTAIN_OIL,
FX_TYPE_THWACK,
FX_TYPE_LIGHTNING_BOLT, FX_TYPE_LIGHTNING_BOLT,
FX_TYPE_LIGHTNING_SHEET, FX_TYPE_LIGHTNING_SHEET,
FX_TYPE_LIGHTNING_BLAST, FX_TYPE_LIGHTNING_BLAST,

View file

@ -1,6 +1,6 @@
/***********************/ /*****************/
/*** Anim Base Class ***/ /*** Thwack!!! ***/
/***********************/ /*****************/
#include "system\global.h" #include "system\global.h"
#include <DStructs.h> #include <DStructs.h>
@ -10,40 +10,39 @@
#include <sprites.h> #include <sprites.h>
#include "level\level.h" #include "level\level.h"
#include "game\game.h" #include "game\game.h"
#include "gfx\otpos.h"
#include "FX\FXBaseAnim.h" #include "FX\FXThwack.h"
#include "FX\FXAttachAnim.h"
const int ThwackLife=12;
/*****************************************************************************/ /*****************************************************************************/
void CFXAttachAnim::init(DVECTOR const &_Pos) void CFXThwack::init(DVECTOR const &_Pos)
{ {
CFXBaseAnim::init(_Pos); CFX::init(_Pos);
Life=ThwackLife;
OtPos=OTPOS__ACTOR_POS-1;
Angle=getRnd()&4095;
Scale=2048+1024+(getRnd()&2047);
} }
/*****************************************************************************/ /*****************************************************************************/
/*** Render ******************************************************************/ /*** Render ******************************************************************/
/*****************************************************************************/ /*****************************************************************************/
void CFXAttachAnim::render()
void CFXThwack::render()
{ {
CFXBaseAnim::render(); DVECTOR RenderPos;
getFXRenderPos(RenderPos);
if (!canRender() || !IsVisible) return; if (!canRender() || !IsVisible) return;
CThing *Parent=getParent(); SpriteBank *SprBank=CGameScene::getSpriteBank();
ASSERT(Parent); POLY_FT4 *Ft4=SprBank->printRotatedScaledSprite(FRM__THWACK,RenderPos.vx,RenderPos.vy,Scale,Scale,Angle,OtPos);
setSemiTrans(Ft4,1);
DVECTOR &ParentPos=Parent->getRenderPos(); Ft4->tpage|=1<<5;
int FrameW=Frame->x1-Frame->x0; int Col=(256/ThwackLife)*Life;
int HalfW=FrameW>>1; setRGB0(Ft4,Col,Col,Col);
Frame->x0=ParentPos.vx-HalfW;
Frame->y0=ParentPos.vy;
Frame->x1=ParentPos.vx+HalfW;
Frame->y1=ParentPos.vy;
int BY=Frame->y2-Frame->y0;
// setCollisionCentreOffset(0,BY>>1);
setCollisionSize(FrameW,BY*2);
} }

View file

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