1
This commit is contained in:
parent
09d724202a
commit
d4eb937be5
@ -91,13 +91,22 @@ void Android::InternalUpdate(int delta_time)
|
||||
if (GetMoveHelper()->GetPathSize() > 0) {
|
||||
Global::Instance()->verify_set_pos = 1;
|
||||
int speed = std::max(1, (int)GetSpeed()) * 1;
|
||||
a8::Vec2 old_pos = GetPos();
|
||||
_UpdateMove(speed);
|
||||
#ifdef DEBUG1
|
||||
a8::XPrintf("updatemove old_pos:%f,%f new_pos:%f,%f\n",
|
||||
{
|
||||
old_pos.x,
|
||||
old_pos.y,
|
||||
GetPos().x,
|
||||
GetPos().y,
|
||||
});
|
||||
#endif
|
||||
Global::Instance()->verify_set_pos = 0;
|
||||
}
|
||||
behaviac::EBTStatus status = f8::BtMgr::Instance()->BtExec(agent_);
|
||||
#if 0
|
||||
if (status != behaviac::BT_RUNNING) {
|
||||
abort();
|
||||
#ifdef DEBUG
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -62,7 +62,9 @@ behaviac::EBTStatus AndroidAgent::DoRandomWalk()
|
||||
a8::Vec2 dir = GetOwner()->GetMoveDir();
|
||||
dir.Rotate((10 + rand() % 360)/ 180.0f);
|
||||
dir.Normalize();
|
||||
GetOwner()->GetMoveHelper()->CalcTargetPos(500);
|
||||
GetOwner()->SetMoveDir(dir);
|
||||
GetOwner()->SetAttackDir(dir);
|
||||
GetOwner()->GetMoveHelper()->CalcTargetPos(200);
|
||||
if (GetOwner()->GetMoveHelper()->GetPathSize() <= 0) {
|
||||
return behaviac::BT_FAILURE;
|
||||
}
|
||||
|
@ -231,6 +231,9 @@ bool App::Init(int argc, char* argv[])
|
||||
f8::TGLog::Instance()->Init(a8::Format(PROJ_NAME_FMT, {GAME_ID}), false, 0);
|
||||
f8::HttpClientPool::Instance()->Init(MAX_ALL_HTTP_NUM, MAX_SYS_HTTP_NUM, MAX_USER_HTTP_NUM);
|
||||
f8::BtMgr::Instance()->Init("exported");
|
||||
#ifdef DEBUG
|
||||
f8::BtMgr::Instance()->SetLogging(true);
|
||||
#endif
|
||||
SkillHelper::Init();
|
||||
JsonDataMgr::Instance()->Init();
|
||||
MetaMgr::Instance()->Init();
|
||||
|
@ -70,6 +70,8 @@ bool MoveHelper::GetMovePosition(glm::vec3& out_pos)
|
||||
abort();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
ClearPath();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -136,8 +138,8 @@ void MoveHelper::CalcTargetPos(float distance)
|
||||
point->tar_pos.z < 0) {
|
||||
abort();
|
||||
}
|
||||
#ifdef DEBUG1
|
||||
a8::XPrintf("CalcTargetPos src_pos:%f,%f tar_pos:%f,%f is_hit:%d start:%f,%f,%f end:%f,%f,%f\n",
|
||||
#ifdef DEBUG
|
||||
a8::XPrintf("CalcTargetPos src_pos:%f,%f tar_pos:%f,%f is_hit:%d start:%f,%f,%f end:%f,%f,%f distance:%f\n",
|
||||
{
|
||||
point->src_pos.x,
|
||||
point->src_pos.z,
|
||||
@ -151,7 +153,8 @@ void MoveHelper::CalcTargetPos(float distance)
|
||||
|
||||
end.x,
|
||||
end.y,
|
||||
end.z
|
||||
end.z,
|
||||
point->distance
|
||||
});
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user