Global Event System

It’s very possible to broadcast.

you can simply have subscribers to
different events

By doing exactly that. Objects can register and become listeners. Example:

which in my view is a very good thing
because you avoid spaghetti kinds of
relationships between objects. In fact
an entire game can be set up with this
structure. Why is this considered a
bad practice?

Preach! It’s great practice, imho. In my current project I have (almost) completely eliminated direct references to widgets and rely on delegates exclusively.

There is an upfront cost of it being harder to understand and wire up initially - perhaps that’s why it’s not a part of a primer video. You reap the rewards of having your code despaghettised later on, though.

1 Like