P
P
password222021-04-28 23:35:46
2D
password22, 2021-04-28 23:35:46

How to implement interaction with objects, if for each of its behavior?

Good evening! The idea is that the game has several different characters that the player can control.
The player clicks on any of the characters, thus selecting it, and then clicks on, say, a chair. The character will go to that chair and sit on it.

Or the player will select a character and click on the mirror, this character will approach him and begin to admire himself.

Essence - for each interaction of a character with a specific object, its own behavior, action.

Here's what I can't understand. Here it is better to apply some of the patterns like state or strategy, or just make the character approach the object, and then the ontrigger will work. Or even use events?

In general, I'm confused how to organize all this better ...

I would be glad for any help) thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question