Don't allow the snake to go off the edge.