Exemple #1
0
/**
 * Entry point of program.
 */
int main(int argc, char ** argv)
{
	init();
	while(true) // Keep app running
	{
		setupGame();
		while(game.lives) // New Round
		{
			setupRound();
			while(!game.gameover) // Neither player missed the ball
			{
				getInput();
				processAI();
				moveBall();
				displayOutput();
				
				// Sleep
				PA_CheckLid();
				PA_WaitForVBL();
			}
			postRound();
		}
		postGame();
	}
	return 0;
}
Exemple #2
0
// Creates a new game
void Model::newGame(std::string seed)
{
	if (gameStatus_){
		endGame();
	}
	gameStatus_ = true;
	std::stringstream ss;
    ss << seed;
    ss >> seed_;
	game_ = new Game(playerTypes_, seed_);
	std::cout << "newGame" << std::endl;
	setupRound();
}