feat: first basic enemy patrolling behaviour
This commit is contained in:
parent
7c4c75d193
commit
526f756736
15 changed files with 801 additions and 386 deletions
|
|
@ -7,7 +7,6 @@ class State;
|
|||
class StateMachine : public Node {
|
||||
GDCLASS(StateMachine, Node);
|
||||
static void _bind_methods();
|
||||
void add_state(State *state);
|
||||
void switch_to_state(State *state);
|
||||
void ready();
|
||||
void process(double delta);
|
||||
|
|
@ -15,6 +14,10 @@ class StateMachine : public Node {
|
|||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
~StateMachine();
|
||||
void add_state(State *state);
|
||||
|
||||
private:
|
||||
State *current_state{ nullptr };
|
||||
HashMap<StringName, State *> states{};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue