This commit is contained in:
parent
7766e20044
commit
faed954d91
@ -49,6 +49,19 @@
|
||||
Vars
|
||||
---- */
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CGlassesPickup::init()
|
||||
{
|
||||
CBasePickup::init();
|
||||
|
||||
m_glint=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
@ -60,6 +73,23 @@ void CGlassesPickup::collect(class CPlayer *_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:
|
||||
Purpose:
|
||||
@ -77,6 +107,12 @@ void CGlassesPickup::renderPickup(DVECTOR *_pos)
|
||||
x=_pos->vx-(fh->W/2);
|
||||
y=_pos->vy-(fh->H/2);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
@ -37,11 +37,17 @@
|
||||
class CGlassesPickup : public CBasePickup
|
||||
{
|
||||
public:
|
||||
virtual void init();
|
||||
|
||||
virtual void collect(class CPlayer *_player);
|
||||
|
||||
protected:
|
||||
virtual void thinkPickup(int _frames);
|
||||
virtual void renderPickup(DVECTOR *_pos);
|
||||
|
||||
private:
|
||||
int m_glint;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user