I'm not too sure at all that this will help
and I confess that I didn't read the actual code,
and I didn't quite understood if the spheres were colliding between them or with the border itself
I once had a tiny bit similar problem that I couldn't understand for too much time.
but basically a hit was printed twice because both of the objects were registering a hit,
so whenever they've hit each other two hit messages were printed.
I used their ID(or place in a list or something similar)
so only one of them (the one with the bigger ID) will print the message
I have no idea if that helps but it might just be it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…