add walk zone
This commit is contained in:
parent
d9b4ce5554
commit
5669d2d156
@ -29,6 +29,7 @@ enum HumanStatus
|
||||
|
||||
struct xtimer_list;
|
||||
class CircleCollider;
|
||||
class AabbCollider;
|
||||
class Obstacle;
|
||||
class Human : public Entity
|
||||
{
|
||||
@ -219,6 +220,9 @@ protected:
|
||||
std::set<Human*> observers_;
|
||||
Human* follow_target_ = nullptr;
|
||||
bool follow_synced_active_player = false;
|
||||
AabbCollider* walk_zone = nullptr;
|
||||
std::set<ColliderComponent*> seen_colliders;
|
||||
ColliderComponent* last_collider = nullptr;
|
||||
|
||||
private:
|
||||
CircleCollider* self_collider_ = nullptr;
|
||||
|
@ -120,17 +120,10 @@ void Player::UpdateMove()
|
||||
pos = pos + move_dir;
|
||||
if (IsCollision()) {
|
||||
pos = old_pos;
|
||||
#if 1
|
||||
FindPath();
|
||||
if (rand() % 3 == 0) {
|
||||
i += 1;
|
||||
}
|
||||
#else
|
||||
if (i == 0) {
|
||||
FindPath();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
room->grid_service.MoveHuman(this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user