This commit is contained in:
Paul 2001-03-27 20:29:02 +00:00
parent a07b1ae87a
commit 5653705bd9
7 changed files with 259 additions and 7 deletions

View file

@ -17,6 +17,14 @@
#include "player\pmbloon.h"
#ifndef __GFX_SPRBANK_H__
#include "gfx\sprbank.h"
#endif
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
/* Std Lib
------- */
@ -24,6 +32,11 @@
/* Data
---- */
#ifndef __SPR_INGAMEFX_H__
#include <ingamefx.h>
#endif
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
@ -54,6 +67,31 @@ static PlayerMetrics s_playerMetrics=
} };
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeBalloon::initialise(class CPlayer *_player)
{
CPlayerModeBase::initialise(_player);
m_sprites=new ("BalloonSprite") SpriteBank();
m_sprites->load(INGAMEFX_INGAMEFX_SPR);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeBalloon::shutdown()
{
m_sprites->dump(); delete m_sprites;
CPlayerModeBase::shutdown();
}
/*----------------------------------------------------------------------
Function:
Purpose:
@ -63,7 +101,7 @@ static PlayerMetrics s_playerMetrics=
void CPlayerModeBalloon::enter()
{
CPlayerModeBase::enter();
m_ballonTimer=BALLOON_TIME;
m_balloonTimer=BALLOON_TIME;
}
/*----------------------------------------------------------------------
@ -75,13 +113,37 @@ void CPlayerModeBalloon::enter()
void CPlayerModeBalloon::think()
{
CPlayerModeBase::think();
if(--m_ballonTimer==0)
if(--m_balloonTimer==0||getPadInputDown()&PI_ACTION)
{
PAUL_DBGMSG("*pop*");
m_player->setMode(PLAYER_MODE_FULLUNARMED);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
int balloonx=-14;
int balloony=-90;
void CPlayerModeBalloon::render()
{
DVECTOR ofs,pos;
CPlayerModeBase::render();
if(m_balloonTimer>BALLOON_FLASH_TIME||
m_balloonTimer&2)
{
ofs=CLevel::getCameraPos();
pos=m_player->getPlayerPos();
pos.vx+=balloonx-ofs.vx;
pos.vy+=balloony-ofs.vy;
m_sprites->printFT4(FRM__BALLOON,pos.vx,pos.vy,0,0,0);
}
}
/*----------------------------------------------------------------------
Function:
Purpose: