In my opinion you're asking the wrong question.
But I don't mean to be rude :D
I see many ways to do what you ask, but all these ways aren't the best way depending on what you want to use your cat for.
If you want to pick a cat with the mouse and make it do something my solution works well.
If you want to apply some action on a black cat but not on the other ones, you can use their animation frame or name ('cause it would be different to show differnt colors') to pick them.
If you want to pick the centered cat, you can compare it's position.
If you want to pick a cat precisely, amongst the same kind of cats (same graphics) whereever it is...
First let me say that I don't see the point to be so specific.
But let say you want to be, you just have to do what Kyat said and assign ID in instance variables at runtime.
Also, if you want to memorize a picking for later uses. Let say you selected one cat at the start of the game, the cat gets hidden under mugs and the mugs get shuffled (like these street performance you know?) you can maybe store its UID in a global variable at runtime and pick by UID afterward.
But in this example I would just simply set a boolean to true on this specific cat when you select it.
Now I hope you understand why I said that you should explain a bit more about your game. We need context to provide the optimal answer.Yann2012-01-09 03:59:00