Bouncing ball app in c++