added general collision function to base class Entity