This example uses the built in Scratch capabilities and less math, than the original projects. But check out the original projects to learn how bouncing works. Nothing to do, just watch. All code by me (@kriblo).