示例#1
0
//************************************************************************
BOOL CCreditsScene::StartNext()
//************************************************************************
{
	if ( !m_pContributors )
		return( NO );

	m_dwLastTime = timeGetTime();
	int i = m_nNextContributor;
	if ( ++m_nNextContributor >= m_nContributors )
		m_nNextContributor = 0;

	PDIB pDib;
	int iType = m_pContributors[i].m_iType;
	if ( !(pDib = TextToDib(m_pContributors[i].m_szName, m_szFaceName[iType], m_ptSize[iType],
					m_fItalic[iType], m_Color[iType], GetPalette(), m_BackgrndColor)) )
		return(NO/*fStarted*/);

	POINT ptOrigin;
	ptOrigin.x = 0;
	ptOrigin.y = 0;
	LPSPRITE lpSprite = m_pAnimator->CreateSprite( &ptOrigin );
	lpSprite->AddCell( pDib, 0, 0 );
	lpSprite->SetSpeed( m_pContributors[i].m_iSpeed );
	lpSprite->SetNotifyProc(::OnSpriteNotify, (DWORD)this);
	int x;
	if (m_fCenter)
	{
	   int iWidth, iHeight;
	   lpSprite->GetMaxSize(&iWidth, &iHeight);
	   x = (RectWidth(&m_rGameArea) - iWidth) / 2;
	   x += m_rGameArea.left;
	}
	else
		x = m_pContributors[i].m_ptStart.x;
	lpSprite->Jump(x, m_pContributors[i].m_ptStart.y);
	lpSprite->Show(TRUE);
	if (!m_fCenter)
		x = m_pContributors[i].m_ptEnd.x;
	lpSprite->AddCmdMove(x, m_pContributors[i].m_ptEnd.y);
	return(YES/*fStarted*/);
}
示例#2
0
//************************************************************************
LPSPRITE CNutDropScene::CreateScoreSprite (int x, int y, int iCell)
//************************************************************************
{
	FNAME szFileName;
	POINT ptOrigin;

	ptOrigin.x = 0;
	ptOrigin.y = 0; 

	LPSPRITE lpSprite = m_pAnimator->CreateSprite (&ptOrigin);
	if (lpSprite && m_szScoreBmp[0] != '\0')
	{
		GetPathName (szFileName, m_szScoreBmp); 
		lpSprite->AddCells (szFileName, m_nScoreCells, NULL);
		lpSprite->SetCellsPerSec (0);
		lpSprite->SetCurrentCell (iCell);
		lpSprite->Jump (x, y);
		lpSprite->Show (TRUE);
	}
	return lpSprite;
}