SBSPSS/source/platform/pplayer.cpp
Charles 9a0ce0adc6
2001-07-03 18:32:04 +00:00

65 lines
1.3 KiB
C++

/*=========================================================================
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::postInit()
{
CNpcBubblePlatform::postInit();
setCollisionSize( 30, 30 );
setCollisionCentreOffset( 0, -15 );
calculateNonRotatedCollisionData();
}*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlayerBubblePlatform::processLifetime( int _frames )
{
m_lifetime -= _frames;
if ( m_pop )
{
if ( m_lifetime <= 0 )
{
setToShutdown();
}
}
else
{
if ( m_lifetime <= 0 )
{
m_pop = true;
m_lifetime = GameState::getOneSecondInFrames() >> 2;
}
else if ( m_lifetime <= ( GameState::getOneSecondInFrames() >> 1 ) )
{
m_scale = ONE + ( ( 256 * rsin( ( m_lifetime << 14 ) / ( GameState::getOneSecondInFrames() >> 1 ) ) ) >> 12 );
}
}
}