summaryrefslogtreecommitdiff
path: root/godot/scripts/fsm/State.gd
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2022-10-11 00:15:48 -0400
committerAnson Bridges <bridges.anson@gmail.com>2022-10-11 00:15:48 -0400
commite7fb9bacf3ebb5209f90f412757c35276af51e85 (patch)
tree2dfac9d1273bf5efa1da5cfe82b4d8e64ae0bf3a /godot/scripts/fsm/State.gd
parent7dbec964a375598d454e04719576eb6c469a5d7b (diff)
ai cannon-manning state machine
Diffstat (limited to 'godot/scripts/fsm/State.gd')
-rw-r--r--godot/scripts/fsm/State.gd22
1 files changed, 22 insertions, 0 deletions
diff --git a/godot/scripts/fsm/State.gd b/godot/scripts/fsm/State.gd
new file mode 100644
index 0000000..be7ba2d
--- /dev/null
+++ b/godot/scripts/fsm/State.gd
@@ -0,0 +1,22 @@
+class_name State
+extends Node
+
+var state_machine = null
+
+# Corresponds to the `_process()` callback.
+func update(_delta: float) -> void:
+ pass
+
+# Virtual function. Corresponds to the `_physics_process()` callback.
+func physics_update(_delta: float) -> void:
+ pass
+
+# Virtual function. Called by the state machine upon changing the active state. The `msg` parameter
+# is a dictionary with arbitrary data the state can use to initialize itself.
+func enter(_msg := {}) -> void:
+ pass
+
+# Virtual function. Called by the state machine before changing the active state. Use this function
+# to clean up the state.
+func exit() -> void:
+ pass