Cómo hacer que un objeto se detenga al final de su lienzo P5JS

y = constrain(y, 0, 570);
Xanthous Xenomorph