Bouncing ball implementation without object oriented approach