Very nice code there, however you have some bugs (as you're already aware). I don't think anyone reported this yet, but occasionally I pop all the balls in a string and the black one just gets stuck there. This happened the first time I played and I was really confused as to how I was supposed to get rid of the black ones.
Looks like this
And there are NO other strings at all visible on the board. When just one black ball is present, my colors cycle through like crazy. I think this occurring has something to do with me shooting the black ball from behind as it goes up that first turn.
Oh and when that black ball reached near the end, I suddenly saw a long stream of sparkles appear backwards up the track the length of 10-15 balls or so and then I proceeded to lose.