2001-05-29 18:55:15 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
pplayer.cpp
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __PLATFORM_PPLAYER_H__
|
|
|
|
#include "platform\pplayer.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GAME_GAME_H__
|
|
|
|
#include "game\game.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __SPR_SPRITES_H__
|
|
|
|
#include <sprites.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void CNpcPlayerBubblePlatform::processLifetime( int _frames )
|
|
|
|
{
|
|
|
|
m_lifetime -= _frames;
|
|
|
|
|
|
|
|
if ( m_pop )
|
|
|
|
{
|
|
|
|
if ( m_lifetime <= 0 )
|
|
|
|
{
|
|
|
|
setToShutdown();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( m_lifetime <= 0 )
|
|
|
|
{
|
|
|
|
m_pop = true;
|
|
|
|
|
2001-07-12 20:53:06 +02:00
|
|
|
if ( m_soundId == NOT_PLAYING )
|
|
|
|
{
|
|
|
|
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_BALLOON_POP, true );
|
|
|
|
}
|
|
|
|
|
2001-05-30 16:12:44 +02:00
|
|
|
m_lifetime = GameState::getOneSecondInFrames() >> 2;
|
2001-05-29 18:55:15 +02:00
|
|
|
}
|
2001-06-29 17:25:28 +02:00
|
|
|
else if ( m_lifetime <= ( GameState::getOneSecondInFrames() >> 1 ) )
|
|
|
|
{
|
|
|
|
m_scale = ONE + ( ( 256 * rsin( ( m_lifetime << 14 ) / ( GameState::getOneSecondInFrames() >> 1 ) ) ) >> 12 );
|
|
|
|
}
|
2001-05-29 18:55:15 +02:00
|
|
|
}
|
|
|
|
}
|