Howdy, I have multiple different ball objects that I want to spawn all from the same location. Each one has a different diameter, sprite, mass and restitution (think basketball vs bowling ball). To start I created a factory that spawns a ball game object and then posts a message to update its sprite and uses go.set_scale
to update its size.
This has worked fine for now, but I realize mass and restitution cannot be updated once the game object is created. I was thinking of having separate game objects, one for each ball, and then spawning these from a single factory. However, it seems a factory can only spawn a single kind of game object.
So now I am thinking of having n factories, where n is number of balls, and having the correct factory spawn the ball when its time to do so. Does this sound like the simplest solution to do what I desire or am I missing something more obvious?