Help with recreation

I have been playing a flash game called Drunken Master ( http://armorgames.com/play/983/drunken-masters ) and I want to be able to recreate the pouring action from it.
I want to be able to have a bottle that rotates with proximity and when it gets close enough to the glass, it pours.

Can anybody help me with this?
Cheers.