📅  最后修改于: 2022-03-11 14:52:25.191000             🧑  作者: Mango
void screenWrap(PVector position) {
if (position.x < 0){ //warp x
position.x += width;
} else {
position.x = position.x % width;
}
if (position.y < 0){ //warp y
position.y += height;
} else {
position.y = position.y % height;
}
}