Esempio n. 1
0
void Pac_MainGame(void *pCtx, GAME_STATE *ptr)
{
tGameEnd iGS;

	Pac_InitialiseGame(ptr);
	Pac_RenderGameInfo(pCtx);
	Pac_RenderRHS(pCtx, ptr);
	do {
		/* Start of sheet/new life */
		DrawDynamic(pCtx, ptr);
		Pac_Blit(pCtx);
		sleep(2);

		iGS = Pac_GameLoop(pCtx, ptr);
		switch(iGS) {
			case	ePAC_SheetComplete: 
					Pac_FlashBoard(pCtx, ptr); 
					ptr->iLevel++;
					Pac_ReinitialiseGame(ptr);
					break;
			case	ePAC_LifeLost:	 
					--ptr->Player.iLives;
					Pac_RenderRHS(pCtx, ptr);
					Pac_AnimateDeadPlayer(pCtx, ptr); 
					if (ptr->Player.iLives < 0)
						return;
					sleep(1);
					Pac_InitialiseGhosts(ptr);
					Pac_ReinitialisePlayer(ptr);
					break;
			default:
					break;
			}
	
	} while(iGS != ePAC_UserQuit);
}
Esempio n. 2
0
void Pac_InitialisePlayer(GAME_STATE *ptr)
{
	ptr->Player.iLives = 3;
	Pac_ReinitialisePlayer(ptr);
}