1void screenWrap(PVector position) {
2 if (position.x < 0){ //warp x
3 position.x += width;
4 } else {
5 position.x = position.x % width;
6 }
7
8 if (position.y < 0){ //warp y
9 position.y += height;
10 } else {
11 position.y = position.y % height;
12 }
13}