Exit on collision with walls or self
Fixed and refactored moveFood function