调整速度

This commit is contained in:
aozhiwei 2019-05-06 19:53:16 +08:00
parent 8d983e2a93
commit 6a30ba3375
4 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,11 @@ float Human::GetSpeed()
return meta->i->move_speed() + buff.speed;
}
float Human::GetSpeed4()
{
return meta->i->move_speed4();
}
void Human::FillMFObjectPart(cs::MFObjectPart* part_data)
{
part_data->set_object_type(ET_Player);

View File

@ -106,6 +106,7 @@ class Human : public Entity
virtual ~Human() override;
virtual void Initialize() override;
virtual float GetSpeed() override;
virtual float GetSpeed4();
virtual void FillMFObjectPart(cs::MFObjectPart* part_data) override;
virtual void FillMFObjectFull(cs::MFObjectFull* full_data) override;
virtual ColliderComponent* GetBoxBound() override;

View File

@ -118,10 +118,15 @@ void Player::UpdateMove()
pos = pos + move_dir;
if (IsCollision()) {
pos = old_pos;
#if 1
FindPath();
i += 1;
#else
if (i == 0) {
FindPath();
}
break;
#endif
}
move_ok = true;
}

View File

@ -88,6 +88,7 @@ message Player
optional float radius = 2; //
optional int32 health = 3; //
optional int32 move_speed = 4; //
optional int32 move_speed4 = 10; //4
optional float def = 5; //
optional string volume = 6; //
}