void Player::move() {//make a move based on the move made by the opponent
		lastMe_ = me;
		sab.setStep(step);
        cout << "Computing. Be patient, it takes time to become intelligent" << endl;
		me = sab.searchAB(curState);		
		if (!checkLose(me))
				curState.update(MAX, me);
		else 
				gameOver = MIN;
		increaseStep();
}
Beispiel #2
0
void Game::timerEvent(QTimerEvent*)
{
	// check to see if any addition is necessary
	checkAddition();

	// advance the scene
	myScene.advance();

	// check to see if the score should be increased
	checkScore();
	// check to see if he wants to jump (and can)
	checkJump();
	// check to see if he is stuck in a wall
	checkWall();
	// check to see if he has hit an obstacle
	checkLose();
	// check to see if removal of items is necessary
	checkDeath();
}