1 sprite, but 4 balls? this is madness! no, this. is. rendering! *kicks* oh, almost forgot, variable counts the collisions as they occur at every frame.
if you don't get what this is about: think of a box. this box have six dogs. you count each dog in the box. this is a list. now what if those six dogs have a unique color and name? you count each dog with their unique color and name. this is a 2D list. you see all six dogs with their unique color and name above them. this is rendering although the engine is more than a render engine since it has a update and collision (badly coded i know) function. ideally the draw function would draw the circles with pen blocks instead instead of stamping. just in case you're confused about render and draw, rendering is in the draw function (bad design i know). and yes, i felt like using custom blocks as functions here.