Make any of the balls stop on top of the pile. Use mousepointer.

Yellow wall bounces the ball harder. Green wall detects a resting ball.

Source-code: .Magball2.java