Beispiel #1
0
//************************************************************************
void CNutDropScene::UpdateSpriteScore (LPSPRITE lpScore1, LPSPRITE lpScore2, int iScore)
//************************************************************************
{
	if (!lpScore1 || !lpScore2)
		return;

	int iTmp = iScore;

	if (iTmp > 99)
		return;

	if (iTmp < 10)
	{
		lpScore2->SetCurrentCell (iTmp);
		lpScore2->Draw();
	}
	else
	{
		lpScore1->SetCurrentCell (iTmp / 10);
		while (iTmp > 10)
			iTmp -= 10;
		if (iTmp == 10)
			iTmp = 0;
		lpScore2->SetCurrentCell (iTmp);
		lpScore1->Draw();
		lpScore2->Draw();
	}
}
Beispiel #2
0
//************************************************************************
void CNutDropScene::ResetSpriteScore (LPSPRITE lpScore1, LPSPRITE lpScore2)
//************************************************************************
{
	if (!lpScore1 || !lpScore2)
		return;

	lpScore1->SetCurrentCell (m_nScoreCells - 1);
	lpScore2->SetCurrentCell (0);
	lpScore1->Draw();
	lpScore2->Draw();
}
Beispiel #3
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;
}