Added obstacle detection to the mouse controls