It's placed inside the if-statement that detects the object being at or past the bottom of the canvas, and has the effect of moving the object back to the exact bottom. So it can never go past the bottom.
Seems reasonable, and now it never goes past the bottom. But now it's over-rebounding again.
|