This commit is contained in:
parent
8ba30ea7ea
commit
7c33350c08
2 changed files with 71 additions and 3 deletions
|
@ -15,11 +15,55 @@
|
||||||
#include "platform\pbubble.h"
|
#include "platform\pbubble.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GAME_GAME_H__
|
||||||
|
#include "game\game.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __SPR_SPRITES_H__
|
||||||
|
#include <sprites.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcBubblePlatform::postInit()
|
||||||
|
{
|
||||||
|
CNpcPlatform::postInit();
|
||||||
|
|
||||||
|
m_pop = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcBubblePlatform::render()
|
||||||
|
{
|
||||||
|
if ( m_isActive || m_pop )
|
||||||
|
{
|
||||||
|
CPlatformThing::render();
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (canRender())
|
||||||
|
{
|
||||||
|
DVECTOR &renderPos=getRenderPos();
|
||||||
|
|
||||||
|
if ( m_pop )
|
||||||
|
{
|
||||||
|
POLY_FT4 *SprFrame = CGameScene::getSpriteBank()->printRotatedScaledSprite( FRM__BALLOONBURST, renderPos.vx, renderPos.vy - 16, 4096 << 1, 4096 << 1, 0, 10 );
|
||||||
|
setRGB0( SprFrame, 128, 128, 255 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_modelGfx->Render(renderPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcBubblePlatform::processMovement( int _frames )
|
void CNpcBubblePlatform::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
if ( !isSetToShutdown() )
|
if ( !isSetToShutdown() && !m_pop )
|
||||||
{
|
{
|
||||||
Pos.vy -= m_speed * _frames;
|
Pos.vy -= m_speed * _frames;
|
||||||
|
|
||||||
|
@ -31,15 +75,34 @@ void CNpcBubblePlatform::processMovement( int _frames )
|
||||||
|
|
||||||
if ( Pos.vy < minY )
|
if ( Pos.vy < minY )
|
||||||
{
|
{
|
||||||
setToShutdown();
|
m_lifetime = GameState::getOneSecondInFrames() >> 2;
|
||||||
|
m_pop = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( Pos.vy < 0 )
|
if ( Pos.vy < 0 )
|
||||||
|
{
|
||||||
|
m_lifetime = GameState::getOneSecondInFrames() >> 2;
|
||||||
|
m_pop = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcBubblePlatform::processLifetime( int _frames )
|
||||||
|
{
|
||||||
|
if ( m_pop )
|
||||||
|
{
|
||||||
|
if ( m_lifetime <= 0 )
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_lifetime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,14 @@
|
||||||
class CNpcBubblePlatform : public CNpcPlatform
|
class CNpcBubblePlatform : public CNpcPlatform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual void render();
|
||||||
|
virtual void postInit();
|
||||||
virtual CRECT const *getThinkBBox();
|
virtual CRECT const *getThinkBBox();
|
||||||
protected:
|
protected:
|
||||||
|
virtual void processLifetime( int _frames );
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
|
|
||||||
|
u8 m_pop;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue