本文整理汇总了C++中MovingObject::GetDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ MovingObject::GetDirection方法的具体用法?C++ MovingObject::GetDirection怎么用?C++ MovingObject::GetDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovingObject
的用法示例。
在下文中一共展示了MovingObject::GetDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShootMissile
//TODO: fix shoot direciton and, if possible amount of objects created
void NPC::ShootMissile()
{
if (!m_flags[eAttacking])
{
//TODO: this isn't properly cleaned up. Also need to add it to Level's object lists
//All in all we need a better way to create projectiles
MovingObject* missile = new MovingObject(m_graphicContext, *m_resourceManager, m_position.x, m_position.y, "Missile");
missile->ConnectSlots(*m_drawSignal, *m_updateSignal);
missile->SetEnvList(m_environment);
missile->SetDirection(m_direction);
if (missile->GetDirection() == eLeft) {
missile->SetSpeed(eXSpeed, -missile->GetSpeed(eXSpeed));
}
StartAttack();
missile->StartMoving(m_direction);
m_timeSinceLastAttack = CL_System::get_time();
}
}