language agnostic - Is there a good example of using a factory method / pattern for creating game objects / characters? -


I want a clear way to create game objects like NPC, bullet and power-up, reduce the amount of inter-dependency Do I believe in specific sections that this is what is used for factory patterns?

I would love to see a good implementation from the real game.

I am not an expert in design patterns, and never use them if I do not understand them. I do not want to use design patterns for this - I want to understand that this problem is the right way to solve this problem.

It seems that you are trying to solve the problem

On this particulary question it is actually possible to give a good implementation because it depends on how your game objects are stored, which they represent.

You should not try to see how to apply a specific pattern to a problem, but to find the correct sollution of your problem, and it can be a design pattern.


Comments