Exemplo n.º 1
0
//Method to Initiate the Game
void TicTacToe::initiateGame()
{
	ClearBoard();
	gameRules();
	
	cout << endl;
	cout << endl;
	
	displayBoard();
	numGamesPlayed++;
}
Exemplo n.º 2
0
void update2(int value)
{
	int i;
	BALL b;
	event e;
	ball_event be;
	vector v1;
	char c = 0;
	if(chance == 0 && gamepause == 0)
	{
		runphytrd = 1;
		gameclock+=GAMETICK;
		while(!isEmpty(queue) && phydone == 1)
		{// do something 
			e = dequeue(queue, queue_mutex);
			if(e.label == 1)
			{//pocketin
				enqueue(rulesque,e,rules_mutex);
			}
			
			if(e.label == 0)
			{
				// command to sinc ballques
				be = dequeue_ball(ballque,ballmutex);
				for(i=0;i<10;i++)
				{
				
					coins[i]=be.arr[i];
				}
			}
			if(e.label==6)
			{
				runphy =0;
				runphytrd = 0;
				stopSim();
				clearQueue(queue);
				chance = 2;
				gameclock =0;
				runphy = 1;
				gameRules();		
				coins[0].pos = relocateStriker();						
			}
		}
		
	}
	glutPostRedisplay();
	glutTimerFunc(GAMETICK , update2 , 0);
}