Popping Bubbles for Points

I modified my falling bubbles code again so that a user can pop bubbles and get points! Who doesn't love getting points! You can also lose the game if you let too many fall through the bottom, but it is pretty tough to do that.

The code was very similar to what I wrote for making the drops go up, except I had to change my handlers to make the removal process more straightforward. I found the bubble colors and speeds changing because two loops were happening at once. I ended up changing my for loops to while loops over the length of the objects object. The index remained the same, although there is still probably a potential for interference.

In order to calculate the score, I decided that bigger bubbles count for more, but also count against you more. Also the speed should play a role, so I ended up at the following calls to update the score:

objects.downscore(objects.sizes[i]/objects.stepSize[i]);
objects.upscore(objects.sizes[i]*objects.stepSize[i]*10);

The game is moderately fun, but it works (I think)!

The code is over at jsfiddle and below.