This commit is contained in:
parent
7fd09224d0
commit
be1f600750
4 changed files with 21 additions and 5 deletions
|
@ -31,6 +31,8 @@ void CNpcCollapsingBubblePlatform::postInit()
|
|||
CNpcPlatform::postInit();
|
||||
|
||||
m_pop = false;
|
||||
m_scale = ONE;
|
||||
m_startCollapse = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -54,9 +56,8 @@ void CNpcCollapsingBubblePlatform::render()
|
|||
else
|
||||
{
|
||||
// Evil hard coded Offsets
|
||||
POLY_FT4 *SprFrame = CGameScene::getSpriteBank()->printFT4( FRM__BUBBLE_1, renderPos.vx-16, renderPos.vy-32, 0, 0, 10 );
|
||||
POLY_FT4 *SprFrame = CGameScene::getSpriteBank()->printRotatedScaledSprite( FRM__BUBBLE_1, renderPos.vx, renderPos.vy - 16, m_scale, ONE, 0, 10 );
|
||||
setRGB0( SprFrame, 128, 128, 255 );
|
||||
// m_modelGfx->Render(renderPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,11 +107,13 @@ void CNpcCollapsingBubblePlatform::processLifetime( int _frames )
|
|||
m_timer = 3 * GameState::getOneSecondInFrames();
|
||||
m_timerType = NPC_PLATFORM_TIMER_RESPAWN;
|
||||
m_pop = false;
|
||||
m_scale = ONE;
|
||||
m_startCollapse = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_contact )
|
||||
if ( m_contact || m_startCollapse )
|
||||
{
|
||||
m_lifetime -= _frames;
|
||||
|
||||
|
@ -119,6 +122,12 @@ void CNpcCollapsingBubblePlatform::processLifetime( int _frames )
|
|||
m_lifetime = GameState::getOneSecondInFrames() >> 2;
|
||||
m_pop = true;
|
||||
}
|
||||
else if ( m_lifetime <= ( GameState::getOneSecondInFrames() >> 1 ) )
|
||||
{
|
||||
m_startCollapse = true;
|
||||
|
||||
m_scale = ONE + ( ( 256 * rsin( ( m_lifetime << 14 ) / ( GameState::getOneSecondInFrames() >> 1 ) ) ) >> 12 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ protected:
|
|||
virtual void processLifetime( int _frames );
|
||||
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||
u8 m_pop;
|
||||
u8 m_startCollapse;
|
||||
s16 m_scale;
|
||||
POLY_FT4 *SprFrame;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ void CNpcPlayerBubblePlatform::postInit()
|
|||
CNpcPlatform::postInit();
|
||||
|
||||
m_pop = false;
|
||||
m_scale = ONE;
|
||||
|
||||
setCollisionSize( 30, 30 );
|
||||
setCollisionCentreOffset( 0, -15 );
|
||||
|
@ -59,6 +60,10 @@ void CNpcPlayerBubblePlatform::processLifetime( int _frames )
|
|||
|
||||
m_lifetime = GameState::getOneSecondInFrames() >> 2;
|
||||
}
|
||||
else if ( m_lifetime <= ( GameState::getOneSecondInFrames() >> 1 ) )
|
||||
{
|
||||
m_scale = ONE + ( ( 256 * rsin( ( m_lifetime << 14 ) / ( GameState::getOneSecondInFrames() >> 1 ) ) ) >> 12 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,9 +88,8 @@ void CNpcPlayerBubblePlatform::render()
|
|||
else
|
||||
{
|
||||
// Evil hard coded Offsets
|
||||
POLY_FT4 *SprFrame = CGameScene::getSpriteBank()->printFT4( FRM__BUBBLE_1, renderPos.vx-16, renderPos.vy-32, 0, 0, 10 );
|
||||
POLY_FT4 *SprFrame = CGameScene::getSpriteBank()->printRotatedScaledSprite( FRM__BUBBLE_1, renderPos.vx, renderPos.vy - 16, m_scale, ONE, 0, 10 );
|
||||
setRGB0( SprFrame, 128, 128, 255 );
|
||||
// m_modelGfx->Render(renderPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ protected:
|
|||
virtual void processLifetime( int _frames );
|
||||
|
||||
u8 m_pop;
|
||||
s16 m_scale;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue