本文整理汇总了C++中Paddle::hitVerticallyWith方法的典型用法代码示例。如果您正苦于以下问题:C++ Paddle::hitVerticallyWith方法的具体用法?C++ Paddle::hitVerticallyWith怎么用?C++ Paddle::hitVerticallyWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paddle
的用法示例。
在下文中一共展示了Paddle::hitVerticallyWith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateNextMoveSimple
void AIManager::calculateNextMoveSimple() {
Paddle* leftPlayer = mWorld->getLeftPlayer();
Wall* bottomWall = mWorld->getBottomWall();
Wall* topWall = mWorld->getTopWall();
if (leftPlayer->hitVerticallyWith(bottomWall)) {
leftPlayer->setDirection(PADDLE_DIRECTION_UP);
}
if (leftPlayer->hitVerticallyWith(topWall)) {
leftPlayer->setDirection(PADDLE_DIRECTION_DOWN);
}
if (leftPlayer->getDirection() == PADDLE_DIRECTION_DOWN) {
mNextMove = MOVE_DOWN;
} else {
mNextMove = MOVE_UP;
}
}
示例2: isLeftPlayerHitTopWall
bool WorldManager::isLeftPlayerHitTopWall() {
Paddle *leftPlayer = mWorld->getLeftPlayer();
Wall *topWall = mWorld->getTopWall();
return leftPlayer->hitVerticallyWith(topWall);
}
示例3: isRightPlayerHitBottomWall
bool WorldManager::isRightPlayerHitBottomWall() {
Paddle *rightPlayer = mWorld->getRightPlayer();
Wall *bottomWall = mWorld->getBottomWall();
return rightPlayer->hitVerticallyWith(bottomWall);
}
示例4: isRightPlayerHitTopWall
bool WorldManager::isRightPlayerHitTopWall() {
Paddle *rightPlayer = mWorld->getRightPlayer();
Wall *topWall = mWorld->getTopWall();
return rightPlayer->hitVerticallyWith(topWall);
}
示例5: isLeftPlayerHitBottomWall
bool WorldManager::isLeftPlayerHitBottomWall() {
Paddle *leftPlayer = mWorld->getLeftPlayer();
Wall *bottomWall = mWorld->getBottomWall();
return leftPlayer->hitVerticallyWith(bottomWall);
}