Add new function checkCollision

Use this function to check collision of enemies and boxes.