How create game object?

Yes, you need a factory component for each different kind of G.O. you want to create. You can spawn as many instances of that G.O. as you want of course.

If you have many different objects that are very similar, you can generally use only one G.O. for all of them. You can use the ‘properties’ argument to factory.create() to give different data to each object that you spawn. Then, on the object’s init() you can use that data to change sprites, colors, properties, behavior, etc.

4 Likes