@TheShaggyDev
  @TheShaggyDev
The Shaggy Dev | Communicating between game objects with the observer pattern @TheShaggyDev | Uploaded June 2022 | Updated October 2024, 35 minutes ago.
One of the most common issues you'll run into in your game development journey is how to let two unrelated objects communicate with one another in a way that doesn't completely ruin the organization and flexibility of your code. The observer pattern is one potential solution to this problem, and makes it easy to let different game objects communicate with one another without coupling your entire application together. With native support in most languages and game engines, it really is something you should keep in your toolbox. We can also expand upon this concept further and introduce the event bus, a way of letting more distant objects connect to one another while still keeping the flexibility of your code intact.

Text version of this video: shaggydev.com/2022/06/01/observer-pattern

More info on the observer pattern: gameprogrammingpatterns.com/observer.html

Background and motivation: 00:00
The observer pattern: 01:34
Observables in practice: 02:52
Global access via an event bus: 05:02
The event bus in practice: 05:31
Final thoughts and further reading: 06:04
Communicating between game objects with the observer patternSetter and getter functions in Godot 3 with setgetHow unit selection works in my tactical strategy gameCreating volume sliders in Godot 4Advanced state machine techniques in Godot 410 small ways to make your life easier in GDScriptFree Loopable Game Music11 tips for writing cleaner codeGodot 4 beta + channel updateCallbacks and function references in Godot 3 using FuncRefsCome join the Discord!How to use the microphone in Godot 3

Communicating between game objects with the observer pattern @TheShaggyDev

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER