Give your enemies a brain. Build a 2D state machine (idle, roam, chase, attack) on CharacterBody2D, with NavigationAgent2D pathfinding and proximity detection.
10
Lessons
1095
XP Reward
Intermediate
Difficulty
No videos to zone out to. You write the code yourself in the browser, and Code Checks show what your code passed as you go.
Campaign preview: Enemy AI in action in the complete 2D top-down RPG


Start the first 2 lessons free. Membership unlocks the other 8, plus every other quest and campaign.
Membership is US$25 per month or US$200 per year. Eligible new members start with 7 days free. Card required.
0 of 10 lessons completed
Member download: included with Guild Hall membership.
It is the finished project for the whole quest. Use it to compare your work or to recover a broken step.
A node-per-state machine, shown on a slime that idles, roams, chases, leaps, staggers and dies. Free to download, MIT licensed, no account needed.
View the free open-source version on GitHub What is in the State Machine projectGive your enemies a brain. Build a 2D state machine (idle, roam, chase, attack) on CharacterBody2D, with NavigationAgent2D pathfinding and proximity detection.
Finish it, then keep the momentum. Here's the logical next step.
Recommended
Inventory System
Quest 7 of 11 in the 2D Top-Down RPG campaign.
Build a flexible inventory system that supports items, stacking, and UI interaction.
Free5-7 hours
Game Feel: Make Combat Hit
Optional. Not part of your current route. Needs: Code From Zero, or you can already read GDScript.
Take a flat, lifeless sword hit and make it land. This quest is all about game feel: the disproportionate, layered feedback that separates a hobby project from a game that feels pro. You build one reusable Juice autoload, adding a single technique each lesson (hit flash, hit-stop, knockback, screen shake, floating damage numbers, impact particles, punchy SFX), then unify them into one Juice.hit() call that scales every effect to the weight of the blow. By the end the same swing you started with hits like a truck.
First 2 lessons free4-6 hours
State Machine AI for 3D Enemies
Optional. Not part of your current route. Needs: Code From Zero, or you can already read GDScript.
Build a full state machine AI for 3D enemies in Godot 4.x. They chase, attack, circle, back away, and react to damage with real knockback and combo tracking, the kind of enemy that actually feels alive.
First 4 lessons free10-14 hours
Browse campaigns Submit a build to the Showcase Back to your dashboard