Experimental code to keep consistent game core speed regardless of frame rate. I'm doing this from memory from my game coding days in C many many many many many many many years ago! So it's probably not quite right! The better way of doing this sort of thing is with Delta timing but that gets complicated very quickly! Take a look inside, increase the number of balls or the updates per second. The updates per second will change the speed of the balls (the game core speed) so more updates will increase the speed of the balls, lower updates will decrease their speed. Having too many updates per second in your game core can cause strain have hang the whole thing, too low and your game will never be smooth. Having 60 updates per second will allow your game to be a smooth as possible at 60fps.
If you use this credit would be lovely.