Offer for flexible game communication between objects

I am currently developing a game called Flex, which is a kind of board and card game. Thinking of developing other games using entities from this, I chose to create my entities separate from the game and even from other game objects. As a result, I am currently using events to communicate between my game objects.

The objects of the game, in my case, relate, for example, to the game component of a player who can receive a card or send a card to another unknown component using special requests and transactions. For example, the same can happen with a deck of cardholder components.

In the beginning, this approach turned out to be a good designer, but after a while in my game controller class there are a lot of event handler functions that started to look bad for me.

My current idea is to create a game event manager in conjunction with my game controller to handle events and clear controller code.

Finally, I am not sure that my design decision has been laid out above, so I would like to know about you about which communication design will be indicated for such games.

I hope that answers to this question can help other people. Thanks in advance.

+3
source share
1 answer

? spearate . , .

:

  • MainController - "" , ​​ , , ..

  • GameController - , , , ..

  • EntityController - (, ?).

, , .

, , . Swiz . Swiz , swizframework.org.

0

Source: https://habr.com/ru/post/1775238/


All Articles