Change head of the snake according to direction.