本文整理汇总了C++中TMonsterAIUtil::CheckMovingCondition方法的典型用法代码示例。如果您正苦于以下问题:C++ TMonsterAIUtil::CheckMovingCondition方法的具体用法?C++ TMonsterAIUtil::CheckMovingCondition怎么用?C++ TMonsterAIUtil::CheckMovingCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMonsterAIUtil
的用法示例。
在下文中一共展示了TMonsterAIUtil::CheckMovingCondition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MonsterMove
void TMonsterAI::MonsterMove(int iIndex)
{
LPOBJ lpObj = &gObj[iIndex];
if ( MONSTER_UTIL.CheckMovingCondition(lpObj) == FALSE )
{
lpObj->PathCur = 0;
lpObj->PathCount = 0;
lpObj->PathStartEnd = 0;
memset(lpObj->PathX, 0, sizeof(lpObj->PathX));
memset(lpObj->PathY, 0, sizeof(lpObj->PathY));
memset(lpObj->PathDir, 0, sizeof(lpObj->PathY)); //check this out
return ;
}
if ( lpObj->PathCount != 0 )
{
DWORD dwMoveTime = 0;
DWORD dwDelayTime = 0;
if ( lpObj->DelayLevel != 0 )
dwDelayTime = 300;
else
dwDelayTime = 0;
lpObj->m_MoveSpeed = 300;
if ( (lpObj->PathDir[lpObj->PathCur] % 2 ) == 0 )
dwMoveTime = (DWORD)((double)(lpObj->m_MoveSpeed + dwDelayTime) * 1.3);
else
dwMoveTime = lpObj->m_MoveSpeed + dwDelayTime;
if ( (GetTickCount() - lpObj->PathTime) > dwMoveTime )
{
if ( lpObj->PathCur < 15 )
{
lpObj->X = lpObj->PathX[lpObj->PathCur];
lpObj->Y = lpObj->PathY[lpObj->PathCur];
lpObj->Dir = lpObj->PathDir[lpObj->PathCur];
lpObj->PathTime = GetTickCount();
lpObj->PathCur++;
if ( lpObj->PathCur >= lpObj->PathCount )
{
lpObj->PathCur = 0;
lpObj->PathCount = 0;
lpObj->PathStartEnd = 0;
}
}
CreateFrustrum(lpObj->X, lpObj->Y, iIndex);
}
return;
}
lpObj->PathCur = 0;
lpObj->PathCount = 0;
lpObj->PathStartEnd = 0;
memset(lpObj->PathX, 0, sizeof(lpObj->PathX));
memset(lpObj->PathY, 0, sizeof(lpObj->PathY));
memset(lpObj->PathDir, 0, sizeof(lpObj->PathY)); //check this out
}