void Scene::renderDbg( Graphics2D& g , Vec2f const& pos , int index ) { bool isEven = mLevel.isEvenLayer( index ); Vec2f cPos = mLevel.calcCellCenterPos( index ); g.setBrush( ColorKey3( 0 , 0 , 255 ) ); g.drawCircle( pos + cPos , int( g_BubbleRadius - 10) ); g.setBrush( ColorKey3( 255 , 255 , 0 ) ); for( int i = 0 ; i < NUM_LINK_DIR ; ++i ) { int linkIdx = mLevel.getLinkCellIndex( index , LinkDir(i) , isEven ); //BubbleCell& linkCell = mLevel.getCell( linkIdx ); Vec2f cPos = mLevel.calcCellCenterPos( linkIdx ); g.drawCircle( pos + cPos , int( g_BubbleRadius -10) ); } //g.setBrush( ColorKey3( 255 , 0 , 0 ) ); //for( int i = 0 ; i < mLevel.mNumFallCell ; ++i ) //{ // Vec2f cPos = mLevel.calcCellCenterPos( mLevel.mIndexFallCell[i] ); // g.drawCircle( pos + cPos , g_BubbleRadius - 5 ); //} }
void Scene::renderBubble( Graphics2D& g , Vec2f const& pos , int color ) { RenderUtility::setPen( g , Color::eBlack ); RenderUtility::setBrush( g , color , COLOR_NORMAL); g.drawCircle( pos , int( g_BubbleRadius ) ); RenderUtility::setBrush( g , color , COLOR_DEEP ); RenderUtility::setPen( g , Color::eNull ); g.drawCircle( pos , int( g_BubbleRadius - 5.0 ) ); RenderUtility::setBrush( g , color , COLOR_LIGHT ); g.drawCircle( pos + Vec2f( 5 , -5 ) , 5 ); }
void Scene::renderLauncher( Graphics2D& g , Vec2f const& pos ) { RenderUtility::setBrush( g , mLevel.mShootBubbleColor ); RenderUtility::setPen( g , mLevel.mShootBubbleColor ); Vec2f bPos = pos + mLevel.mLauncherPos; Vec2f startPos = bPos + 10 * mLevel.mLauncherDir; Vec2f offset = 15 * mLevel.mLauncherDir; int idx = ( mTimeCount / 120 ) % 13 - 4; for( int i = 0 ; i < 5 ; ++ i ) { int r = std::max( 1 , 5 - abs( idx - i ) ); startPos += offset; g.drawCircle( startPos , r ); } //g.drawLine( bPos , bPos + 60 * mLevel.mLauncherDir ); renderBubble( g , bPos , mLevel.mShootBubbleColor ); }