You would need an int field to track the vertical speed. Increase its value by one each act cycle to introduce gravity. If the actor is found to intersect any object while moving vertically, set the vertical speed to zero and move the actor back (opposite the direction it moved) off the object. The direction it moved can be determined by the sign of the field holding the vertical speed.