Tech
What I learned building an enemy state machine in Godot 4
I wrote "just use a match statement, it's fine" three times before I stopped saying it. It
is fine, right up until an enemy needs a fourth state and two of the transitions start
depending on each other. Here is what actually cost time building enemy AI for a
wave-based game, in the order it bit me.
Lesson 1: the match statement is fine until state 4
A two-state enemy β chase, attack β is genuinely not worth a framework:
func _physics_process ( delta : float ) ...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to