Added collision logic for different types of collisions. NOT FULLY IMPLEMENTED YET.