Example #1
0
void WorldManager::updateRightPlayer(PaddleMove direction) {
	Paddle *rightPlayer = mWorld->getRightPlayer();
	if (direction == MOVE_DOWN && !isRightPlayerHitBottomWall()) {
		rightPlayer->setDirection(Ogre::Vector3(0, -1, 0));
	} else if (direction == MOVE_UP && !isRightPlayerHitTopWall()) {
		rightPlayer->setDirection(Ogre::Vector3(0, 1, 0));
	} else {
		rightPlayer->stop();
	}
}
Example #2
0
void WorldManager::updateLeftPlayer(PaddleMove direction) {
	Paddle *leftPlayer = mWorld->getLeftPlayer();
	if (direction == MOVE_DOWN && !isLeftPlayerHitBottomWall()) {
		leftPlayer->setDirection(PADDLE_DIRECTION_DOWN);
	} else if (direction == MOVE_UP && !isLeftPlayerHitTopWall()) {
		leftPlayer->setDirection(PADDLE_DIRECTION_UP);
	} else {
		leftPlayer->stop();
	}
}