]> git.localhorst.tv Git - blank.git/blob - src/ai/RandomWalk.hpp
randomly spawn entities around the player
[blank.git] / src / ai / RandomWalk.hpp
1 #ifndef BLANK_APP_RANDOMWALK_HPP_
2 #define BLANK_APP_RANDOMWALK_HPP_
3
4 #include <glm/glm.hpp>
5
6
7 namespace blank {
8
9 class Entity;
10
11 /// Randomly start or stop moving in axis directions every now and then.
12 class RandomWalk {
13
14 public:
15         explicit RandomWalk(Entity &) noexcept;
16
17         Entity &Controlled() noexcept { return entity; }
18         const Entity &Controlled() const noexcept { return entity; }
19
20         void Update(int dt) noexcept;
21
22 private:
23         Entity &entity;
24
25         int time_left;
26
27 };
28
29 }
30
31 #endif