This commit is contained in:
Paul 2001-02-23 21:40:22 +00:00
parent 7766e20044
commit faed954d91
2 changed files with 42 additions and 0 deletions

View File

@ -49,6 +49,19 @@
Vars Vars
---- */ ---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CGlassesPickup::init()
{
CBasePickup::init();
m_glint=0;
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:
@ -60,6 +73,23 @@ void CGlassesPickup::collect(class CPlayer *_player)
CBasePickup::collect(_player); CBasePickup::collect(_player);
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int glasses_glintspeed=1;
int glasses_glintframes=20;
int glasses_glintwait=500;
DVECTOR glasses_gxy={-3,-4};
int glasses_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4};
void CGlassesPickup::thinkPickup(int _frames)
{
m_glint+=_frames*glasses_glintspeed;
if(m_glint>glasses_glintframes+glasses_glintwait)m_glint=0;
}
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Function: Function:
Purpose: Purpose:
@ -77,6 +107,12 @@ void CGlassesPickup::renderPickup(DVECTOR *_pos)
x=_pos->vx-(fh->W/2); x=_pos->vx-(fh->W/2);
y=_pos->vy-(fh->H/2); y=_pos->vy-(fh->H/2);
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS); sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
if(m_glint<=glasses_glintframes)
{
fh=sprites->getFrameHeader(glasses_glintFrames[m_glint&0x03]);
sprites->printFT4(fh,x+glasses_gxy.vx,y+glasses_gxy.vy,0,0,PICKUPS_OT_POS-1);
}
} }
/*=========================================================================== /*===========================================================================

View File

@ -37,11 +37,17 @@
class CGlassesPickup : public CBasePickup class CGlassesPickup : public CBasePickup
{ {
public: public:
virtual void init();
virtual void collect(class CPlayer *_player); virtual void collect(class CPlayer *_player);
protected: protected:
virtual void thinkPickup(int _frames);
virtual void renderPickup(DVECTOR *_pos); virtual void renderPickup(DVECTOR *_pos);
private:
int m_glint;
}; };