本文整理汇总了C++中Bot::getCurrentState方法的典型用法代码示例。如果您正苦于以下问题:C++ Bot::getCurrentState方法的具体用法?C++ Bot::getCurrentState怎么用?C++ Bot::getCurrentState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot::getCurrentState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSpriteItemsToRenderList
/*
addSpriteItemsToRenderList - This method goes through all of the sprites,
including the player sprite, and adds the visible ones to the render list.
This method should be called each frame.
*/
void SpriteManager::addSpriteItemsToRenderList( Game *game)
{
GameStateManager *gsm = game->getGSM();
GameGUI *gui = game->getGUI();
if (gsm->isWorldRenderable())
{
GameGraphics *graphics = game->getGraphics();
RenderList *renderList = graphics->getWorldRenderList();
Viewport *viewport = gui->getViewport();
// ADD THE PLAYER SPRITE
addSpriteToRenderList(&player, renderList, viewport);
/* X = player.getPhysicalProperties() -> getX();
Y = player.getPhysicalProperties() -> getY();*/
//addSpriteToRenderList(&healthBar, renderList, viewport);
// NOW ADD THE REST OF THE SPRITES
list<Bot*>::iterator botIterator;
botIterator = bots.begin();
while (botIterator != bots.end())
{
Bot *bot = (*botIterator);
if (bot->getCurrentState() == L"DYING" && bot->getRemoval() > 0)
bot->setRemoval(bot->getRemoval()-1);
if (bot->getRemoval() != 0) {
addSpriteToRenderList(bot, renderList, viewport);
}
if (bot->getRemoval() == 0){
//bot->setCurrentlyCollidable(false);
}
botIterator++;
}
}
}
示例2: gameWorldStep
//.........这里部分代码省略.........
viewport->setScrollSpeedX(0);
viewport->moveViewport(0, 0, 3200, 3200);
lavaBossFight = true;
}
else
{
viewport->setScrollSpeedX(viewportConverter * 1);
viewport->moveViewport(viewportConverter * 1, 0, 3200, 3200);
}
}
active++;
}
return;
}
}
else if (lavaBossFight == true)
{
playerBody->SetLinearVelocity(playerV);
gameWorld->Step(timeStep, velocityIterations, positionIterations);
gameWorld->ClearForces();
playerMoveLeft = false;
playerMoveRight = false;
playerMoveUp = false;
playerMoveDown = false;
viewportMoved = false;
mouseClicked = false;
list<Bot*>::iterator active = game->getGSM()->getSpriteManager()->getBotsIterator();
while (active != game->getGSM()->getSpriteManager()->getEndOfBotsIterator())
{
Bot *b = (*active);
if (b->getType() == L"LAVA_BOSS")
{
if (b->getCurrentState() == L"DEAD")
{
viewport->setScrollSpeedX(0);
viewport->moveViewport(0, 0, 3200, 3200);
lavaBossFight = false;
}
}
active++;
}
return;
}
}
if ((viewport->getViewportX() <= 0.0f || viewport->getViewportX() >= 3200))
outsideX = false;
else if (playerX >= 492 && playerX <= 532)
outsideX = false;
else
outsideX = true;
if ((viewport->getViewportY() <= 0.0f || viewport->getViewportY() >= 3200))
outsideY = false;
else if (playerY >= 492 && playerY <= 532)
outsideY = false;
else
outsideY = true;
if (viewport->getViewportX() <= 0.0f || viewport->getViewportX() >= 3200)
{
if (playerX >= 507 && playerX <= 512)
{
if (game->getGSM()->getPhyiscs()->getPlayerBody()->GetLinearVelocity().x != 0)
{