Gamedev In-depth: Steering Behaviors (Flee) @Kidscancode
Gamedev In-depth: Steering Behaviors (Flee)  @Kidscancode
Uploaded September 2016 | Updated September 2026, 2 weeks ago
AI is hard, but in gamedev you often want autonomous agents in your game (animals, enemies, guards, etc) that behave in a realistic way. "Steering Behaviors" are a simple way of applying various forces to a unit's movement that generate realistic behaviors like chasing, fleeing, following, etc.

In this third video on steering behaviors, we'll try out the "flee" behavior, making an autonomous sprite that will run away from the player (or any other object).

Code for this example: github.com/kidscancode/pygame_tutorials/blob/master/examples/steering/part03.py

For a great resource on this topic, see the book "The Nature of Code":
natureofcode.com/book/chapter-6-autonomous-agents

"In-depth Topics" will explore and explain a little more deeply certain subjects that may be tricky for new programmers to understand, or that may not quite fit into the usual tutorial structure. Most will likely be math related, but they may also cover other topics that come up or are requested by viewers.

Note: While the examples here will be using Python/Pygame, the actual material will apply more generally to all game development, regardless of what language you may be using.

If you like these videos please consider supporting me on Patreon: patreon.com/kidscancode
Gamedev In-depth: Steering Behaviors (Flee)Godot Engine - Know Your Nodes: RayCast2DGamedev In-depth: Pathfinding Part 4: Dijkstras AlgorithmGame Development 1-3: More About SpritesGamedev In-depth: Steering Behaviors (Seeking)Godot Recipe: 8-way Movement & AnimationGodot 101 - Part 1: Introduction to Godot (For Godot 2.1!)Tile-based game Part 7: MobsCircle Jump: A Godot Mobile Game (Part 12)Godot 3.0: Top-down Tank Battle - Part 2Godot 101 - Part 2: ScriptingPygame Platformer Part 18: Scrolling Background
KidsCanCode |

Gamedev In-depth: Steering Behaviors (Flee)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER