added onStack function

detect when two objects have been stacked on top of each other
added example for onStack