本文整理汇总了C++中CCharacter::IsGrounded方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::IsGrounded方法的具体用法?C++ CCharacter::IsGrounded怎么用?C++ CCharacter::IsGrounded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::IsGrounded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
//.........这里部分代码省略.........
int Time = Server()->TickSpeed();
if (Server()->TickSpeed() / 30 + GetTimeLeft()*8 < Time)
Time = Server()->TickSpeed() / 20 + GetTimeLeft()*4;
if (++m_BombSoundTimer >= Time)
{
m_BombSoundTimer = 0;
GameServer()->CreateSound(B->m_Pos, SOUND_CHAT_SERVER);
GameServer()->CreateSound(B->m_Pos, SOUND_CHAT_SERVER);
}
// bomb defusing
//CCharacter *apCloseCCharacters[MAX_CLIENTS];
//int Num = GameServer()->m_World.FindEntities(B->m_Pos, CFlag::ms_PhysSize * 2, (CEntity**)apCloseCCharacters, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
bool DefusingBomb = false;
for (int i = 0; i < MAX_CLIENTS; i++)
{
CPlayer *pPlayer = GameServer()->m_apPlayers[i];
if(!pPlayer)
continue;
CCharacter *pCharacter = pPlayer->GetCharacter();
if (!pCharacter)
continue;
if(!pCharacter->IsAlive() || pPlayer->GetTeam() != m_DefendingTeam)
continue;
// check distance
if (abs(pCharacter->m_Pos.x - B->m_Pos.x) < 150 && abs(pCharacter->m_Pos.y - B->m_Pos.y) < 150 &&
pCharacter->IsGrounded())
{
DefusingBomb = true;
m_aDefusing[i] = true;
pPlayer->m_InterestPoints += 7;
if (m_BombDefuseTimer == 0)
{
GameServer()->SendBroadcast("Defusing bomb", pPlayer->GetCID());
//GameServer()->CreateSoundGlobal(SOUND_CTF_DROP, pPlayer->GetCID());
}
}
else
{
if (m_aDefusing[i])
{
m_aDefusing[i] = false;
GameServer()->SendBroadcast("", pPlayer->GetCID());
}
}
}
if (DefusingBomb)
{
// bomb defusing sound
if (++m_BombActionTimer >= Server()->TickSpeed()/4)
{
m_BombActionTimer = 0;
GameServer()->CreateSound(B->m_Pos, SOUND_BODY_LAND);
}
if (++m_BombDefuseTimer >= g_Config.m_SvBombDefuseTime*Server()->TickSpeed())