Yes, basically, you do the same, just give the balls colors before or after naming them, either by ActiveBall.Color or ActiveBall.Image. My example used numbers as the UserValue, but you can set that to a string also, like "blue". UserValue is a variant data type.
What you have to watch for is when you destroy a ball. You have to grab that UserValue to a temp variable before destroying the ball. Then reassign it to a new ball when it's created.
Sleepy's snipit with the ace and cat assures that you are creating a ball with a unique ball object name along with a unique ball UserValue.
The object name is handy to get or set x, y, z (ball positions) and/or velx, vely, velz (ball velosity). You can pretty much change anything scriptable to that individual ball object (Image, Front and Back Decal, Color, and even UserValue). This gives you a direct handle to an instance of the ball object. Where did he do this? Here:
Code:
Dim ace, cat
Set ace = Plunger.CreateBall
Set cat = Plunger.CreateBall
The UserValue is handy to track the balls and to use as values in a routine. Example: If you want one ball to score twice the points over any other ball, you could set the UserValue to 2. Then when that ball does a hit event on a object, in that hit routine you have score = score + (100 * ActiveBall.UserValue). All other balls would have 1 as their UserValue. So normal ball would score 100 (100 * 1) and the special ball would score 200 (100 * 2).
The best part of setting the UserValue is that you don't have to know where it is. You don't have to have a timer looking at it's x and y position and draining VP resources.
Most objects in VP have a UserValue (bumpers, spinner, targets, gates, etc...). Think of these as built in variant variables for each object. You can store any type of value in them. Example: Bumper1.UserValue = "Hi There" or Wall1.UserValue = 1.
You can also preset these values in the editor in properties. Last item on all these objects has a box called User Value. What you store in them is up to you, could be points, could be a tracking id, could be some girl's phone number if you're trying to hide it from your wife or girlfriend.
Here is the demo with color cups and color balls. If the ball doesn't match the cup it is kicked.