本文整理汇总了C++中AnimatedSprite::setGrounded方法的典型用法代码示例。如果您正苦于以下问题:C++ AnimatedSprite::setGrounded方法的具体用法?C++ AnimatedSprite::setGrounded怎么用?C++ AnimatedSprite::setGrounded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnimatedSprite
的用法示例。
在下文中一共展示了AnimatedSprite::setGrounded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleKeyEvents
//.........这里部分代码省略.........
}
else if (phy->CurrentGrav == phy->Left_Grav)
{
player->body->SetTransform(player->body->GetPosition(), 270.0f);
blocks = gsm->getSpriteManager()->getBlocksIterator();
while (blocks != gsm->getSpriteManager()->getEndOfBlocksIterator())
{
(*blocks)->body->SetGravityScale(0);
blocks++;
}
world->SetGravity(phy->Right_Grav);
phy->CurrentGrav = phy->Right_Grav;
}
else if (phy->CurrentGrav == phy->Right_Grav)
{
player->body->SetTransform(player->body->GetPosition(), 0.0f);
blocks = gsm->getSpriteManager()->getBlocksIterator();
while (blocks != gsm->getSpriteManager()->getEndOfBlocksIterator())
{
(*blocks)->body->SetGravityScale(1);
blocks++;
}
world->SetGravity(phy->Normal_Grav);
phy->CurrentGrav = phy->Normal_Grav;
}
player->setGrounded(false);*/
}
else if (player->onGround())
{
if (player->dead == false)
{
if (pp->facing == 0)
{
if (phy->CurrentGrav == phy->Normal_Grav)
player->setCurrentState(RIDLE);
else if (phy->CurrentGrav == phy->Reverse_Grav)
player->setCurrentState(URIDLE);
else if (phy->CurrentGrav == phy->Right_Grav)
player->setCurrentState(RRIDLE);
else if (phy->CurrentGrav == phy->Left_Grav)
player->setCurrentState(LRIDLE);
}
else
{
if (phy->CurrentGrav == phy->Normal_Grav)
player->setCurrentState(LIDLE);
else if (phy->CurrentGrav == phy->Reverse_Grav)
player->setCurrentState(ULIDLE);
else if (phy->CurrentGrav == phy->Right_Grav)
player->setCurrentState(RLIDLE);
else if (phy->CurrentGrav == phy->Left_Grav)
player->setCurrentState(LLIDLE);
}
}
else
{