调整速度
This commit is contained in:
parent
8d983e2a93
commit
6a30ba3375
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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; //初始库存
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user