diff --git a/source/platform/pcbubble.cpp b/source/platform/pcbubble.cpp index 3751e50c5..e0d544935 100644 --- a/source/platform/pcbubble.cpp +++ b/source/platform/pcbubble.cpp @@ -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 ); + } } } diff --git a/source/platform/pcbubble.h b/source/platform/pcbubble.h index 601dd0ba6..2038d6f55 100644 --- a/source/platform/pcbubble.h +++ b/source/platform/pcbubble.h @@ -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; }; diff --git a/source/platform/pplayer.cpp b/source/platform/pplayer.cpp index 646385dd8..c0243d61c 100644 --- a/source/platform/pplayer.cpp +++ b/source/platform/pplayer.cpp @@ -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); } } } diff --git a/source/platform/pplayer.h b/source/platform/pplayer.h index e2eeb6da5..ddb9f412e 100644 --- a/source/platform/pplayer.h +++ b/source/platform/pplayer.h @@ -29,6 +29,7 @@ protected: virtual void processLifetime( int _frames ); u8 m_pop; + s16 m_scale; }; #endif \ No newline at end of file