Use Turbo Mode if it's too slow. All dates on the project in yy/mm/dd format due to UK using dd/mm/yy and US using mm/dd/yy. As with all my engines, if you would like to use the script, please credit me and post a link to your project in the comments.
This project uses the Stage to do all the calculations, and a GUI sprite that, using the pen, draws the balls. The original project http://scratch.mit.edu/projects/25908892/ Version History: v1.0: Shared project, but wall collision (left and top) not working properly, and wall bouncing inaccurate where working. (14/10/31) v1.0.1: Fixed top and left but wall bouncing still inaccurate. (14/11/01) v1.0.2: Fixed wall bouncing mechanics. Added documentation to Notes and Credits. (14/11/01) v1.1: Added number of sides on shapes variable for rendering speed compensation. (14/12/10) Documentation: Wall bouncing mechanics - Works in a similar way to bouncing inside a giant circle; the top wall is 0, the right wall is 90, the bottom is 180 and the left wall is 270. Theoretically, it is possible for 360 or greater 'walls' to be sensed, thus generating a pseudo-circle for the balls to bounce in, but this is very difficult, so only 0, 90, 180 and 270 have been included. (14/11/01) Explanation - The divide where positive and negative is 0, so it rotates the numbering around so that 0 is perpendicular to the wall, jumps the ball's to the other side of 0 and then moves the numbering to its original position to read the direction. (14/11/01) Known Glitches: Too many balls means balls that have collided can bounce off another thing and no clip through each other