Learn Create Your Own Split Screen

Next Page

Consider the following two scenarios.

In the first, the ball conveniently bounces exactly at the bottom of the canvas.

In the second, the ball passes the bottom of the canvas "between frames", and by the time we're processing the next frame, has moved to a point beyond the bottom.

With small amounts of gravity, low velocities and fast frame rates, you might never notice. But we may as well make it as perfect as we can, particularly when it seems a simple if-statement will clear this up.