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: https://shaggydev.com/2022/06/01/obse...
More info on the observer pattern: https://gameprogrammingpatterns.com/o...
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 pattern онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь The Shaggy Dev 02 Июнь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,768 раз и оно понравилось 502 людям.