When the snake reaches one of the edges of the screen, make it go through to the other side. For example, after stepping on the right edge, the head's x position should be 0, so that it goes to the edge of the left side. Do the same thing for every direction.
When the snake reaches one of the edges of the screen, make it go through to the other side. For example, after stepping on the right edge, the head's x position should be 0, so that it goes to the edge of the left side. Do the same thing for every direction.