本文整理汇总了C++中CMover::SendActMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ CMover::SendActMsg方法的具体用法?C++ CMover::SendActMsg怎么用?C++ CMover::SendActMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMover
的用法示例。
在下文中一共展示了CMover::SendActMsg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
int CWndWorld::ControlFlying( DWORD dwMessage, CPoint point )
{
static float fTurnAngle = 0.0f;
static BOOL s_bTraceKeyed = 0, s_bSelectKeyed = 0, s_bTurbo2 = 0;
// static BOOL s_bFastTurn;
int nMsg = 0;
// BOOL bFlyKey;
BOOL bUp, bDown, bLeft, bRight;
BOOL bAcc = FALSE;
BOOL bTurbo;
// BOOL bFastTurn = FALSE;
BYTE nFrame = MAX_CORR_SIZE_150;
CMover* pMover = CMover::GetActiveMover();
bUp = g_bKeyTable[g_Neuz.Key.chUp];
bDown = g_bKeyTable['S'];
// 좌/우 회전
bLeft = g_bKeyTable[g_Neuz.Key.chLeft];
bRight = g_bKeyTable['D'];
// 급선회.
// bFastTurn = g_bKeyTable[ VK_SHIFT ];
// CMover* pMoverTarget = (CMover*)g_WorldMng.Get()->GetObjFocus() ;
// 가속 상태면 전진 명령 계속 보냄
bool fMoved = false;
bool fBehavior = false;
if( pMover->m_pActMover->IsStateFlag( OBJSTAF_ACC ) ) {
if( pMover->SendActMsg( OBJMSG_FORWARD ) == 1 ) {
fMoved = true;
}
}
else {
if( pMover->SendActMsg( OBJMSG_STAND ) == 1 ) {
fMoved = true;
}
}
//
bAcc = g_bKeyTable[VK_SPACE];
if( bAcc && !s_bAccKeyed ) // 키 누른순간에만 토글시킴.
{
if( pMover->m_pActMover->IsStateFlag( OBJSTAF_ACC ) ) // 가속중이었다면
{
pMover->SendActMsg( OBJMSG_ACC_STOP ); // 가속 멈춤
if( pMover->m_pActMover->IsActTurn() )
{
fMoved = true;
}
}
else
{
// 가속중이 아니었다면 가속 시킴.
if( pMover->SendActMsg( OBJMSG_ACC_START ) == 0 )
g_WndMng.PutString( prj.GetText( TID_GAME_AIRFUELEMPTY ) );
else
{
if( pMover->SendActMsg( OBJMSG_FORWARD ) == 1 )
fMoved = true;
}
}
}
s_bAccKeyed = bAcc;
bTurbo = g_bKeyTable[g_Neuz.Key.chWalk];
if( bTurbo && !s_bTurbo2 ) // 토글 방식.
{
if( pMover->m_pActMover->IsStateFlag( OBJSTAF_TURBO ) )
{
if( pMover->SendActMsg( OBJMSG_MODE_TURBO_OFF ) == 1 )
fMoved = true;
} else
{
if( pMover->SendActMsg( OBJMSG_MODE_TURBO_ON ) == 1 )
fMoved = true;
}
}
s_bTurbo2 = bTurbo;
if( pMover->m_pActMover->IsFly() )
{
if( g_bKeyTable[g_Neuz.Key.chTrace] && !s_bTraceKeyed )
{
CCtrl* pFocusObj = (CCtrl*)(pMover->GetWorld()->GetObjFocus());
if( pFocusObj && pFocusObj->GetType() == OT_MOVER )
{
CMover* pFocusMover = (CMover*)pFocusObj;
if( pMover->m_dwFlag & MVRF_TRACKING ) // 이미 실행중이면 해제.
{
pMover->m_dwFlag &= (~MVRF_TRACKING); // 추적모드해제.
pMover->m_idTracking = NULL_ID;
} else
{
// 비행중 추적모드.
pMover->m_dwFlag |= MVRF_TRACKING; // 추적모드.
pMover->m_idTracking = pFocusMover->GetId();
}
} else
//.........这里部分代码省略.........