If I want to create a ball, then do stuff with it (e.g. move it around), that's easy. But If I want to create an instance of say a blue, black or red ball, then do the same stuff with which ever one I just created?
E.g. inn bingo, the balls are different colours depending on the number just called.
E.g. if the number is between 1 and 15, create a blue ball
if the number is between 16 and 30, create a green ball.
Then I want to do a whole lot of stuff with that ball. But I dont want to have to duplicate all that code for each ball colour, and I dont think you can pass balls (objects) in as parameters to a function.
I actually solved the problem by making the balls different frames of a single sprite, but I'm interested if there is another way for cases where the sprite hack would not have worked?
Many thanks for your thoughts.