本文整理汇总了C++中SoccerWorld::setBallHitter方法的典型用法代码示例。如果您正苦于以下问题:C++ SoccerWorld::setBallHitter方法的具体用法?C++ SoccerWorld::setBallHitter怎么用?C++ SoccerWorld::setBallHitter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoccerWorld
的用法示例。
在下文中一共展示了SoccerWorld::setBallHitter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//.........这里部分代码省略.........
[&](asIScriptContext* ctx) {
ctx->SetArgDWord(0, kartId);
ctx->SetArgObject(1, lib_id_ptr);
ctx->SetArgObject(2, &obj_id);
});
}
if (obj->isCrashReset())
{
new RescueAnimation(kart);
}
else if (obj->isExplodeKartObject())
{
ExplosionAnimation::create(kart);
if (kart->getKartAnimation() != NULL)
{
World::getWorld()->kartHit(kart->getWorldKartId());
}
}
else if (obj->isFlattenKartObject())
{
const KartProperties *kp = kart->getKartProperties();
// Count squash only once from original state
bool was_squashed = kart->isSquashed();
if (kart->setSquash(kp->getSwatterSquashDuration(),
kp->getSwatterSquashSlowdown()) && !was_squashed)
{
World::getWorld()->kartHit(kart->getWorldKartId());
}
}
else if(obj->isSoccerBall() &&
race_manager->getMinorMode() == RaceManager::MINOR_MODE_SOCCER)
{
SoccerWorld* soccerWorld = (SoccerWorld*)World::getWorld();
soccerWorld->setBallHitter(kartId);
}
continue;
}
if (p->getUserPointer(0)->is(UserPointer::UP_ANIMATION))
{
// Kart hits animation
ThreeDAnimation *anim=p->getUserPointer(0)->getPointerAnimation();
if(anim->isCrashReset())
{
AbstractKart *kart = p->getUserPointer(1)->getPointerKart();
new RescueAnimation(kart);
}
else if (anim->isExplodeKartObject())
{
AbstractKart *kart = p->getUserPointer(1)->getPointerKart();
ExplosionAnimation::create(kart);
if (kart->getKartAnimation() != NULL)
{
World::getWorld()->kartHit(kart->getWorldKartId());
}
}
else if (anim->isFlattenKartObject())
{
AbstractKart *kart = p->getUserPointer(1)->getPointerKart();
const KartProperties *kp = kart->getKartProperties();
// Count squash only once from original state
bool was_squashed = kart->isSquashed();
if (kart->setSquash(kp->getSwatterSquashDuration(),
kp->getSwatterSquashSlowdown()) && !was_squashed)
{