This commit is contained in:
Paul 2001-02-21 22:33:17 +00:00
parent d9de1e680f
commit d27bae5fd0
25 changed files with 392 additions and 190 deletions

View file

@ -21,6 +21,22 @@
#include "pickups\pballoon.h"
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
#ifndef __LAYER_COLLISION_H__
#include "layer\collision.h"
#endif
#ifndef __PRIM_HEADER__
#include "gfx\prim.h"
#endif
#ifndef __MATHTABLE_HEADER__
#include "utils\mathtab.h"
#endif
/* Std Lib
------- */
@ -49,6 +65,18 @@
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBalloonPickup::init()
{
CBaseRespawningPickup::init();
m_sin=0;
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -57,7 +85,49 @@
---------------------------------------------------------------------- */
void CBalloonPickup::collect(class CPlayer *_player)
{
CBasePickup::collect(_player);
CBaseRespawningPickup::collect(_player);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int balloon_height=30;
int balloon_r=180;
int balloon_g=180;
int balloon_b=180;
int balloon_speed=25;
int balloon_scale1=5;
int balloon_scale2=2;
int balloon_phase=1024;
int balloon_vissize=40;
int CBalloonPickup::getVisibilityRadius()
{
return balloon_vissize;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int CBalloonPickup::getRespawnTime()
{
return 60*10;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBalloonPickup::thinkPickup(int _frames)
{
m_sin=(m_sin+(_frames*balloon_speed))&4095;
}
/*----------------------------------------------------------------------
@ -70,13 +140,21 @@ void CBalloonPickup::renderPickup(DVECTOR *_pos)
{
SpriteBank *sprites;
sFrameHdr *fh;
int xo1,xo2;
int x,y;
sprites=getSpriteBank();
fh=sprites->getFrameHeader(FRM__GLASSES);
fh=sprites->getFrameHeader(FRM__BALLOON);
xo1=((msin((m_sin+balloon_phase)&4095)*balloon_scale1)>>12);
xo2=((msin(m_sin)*balloon_scale2)>>12);
x=_pos->vx-(fh->W/2);
y=_pos->vy-(fh->H/2);
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
sprites->printFT4(fh,x+xo1,y,0,0,PICKUPS_OT_POS);
x=_pos->vx;
y=_pos->vy+(fh->H/2);
DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r,balloon_g,balloon_b,PICKUPS_OT_POS);
}
/*===========================================================================