if we have two objects , A and B. Both objects move randomly , if I want the object A incremented by 1 when each time colliding with the object B , what method should I use ?
You should attempt to code it yourself before asking for help. Show what you have tried and ask for help on the code itself -- do not ask us to write the code for you.