0
Bouncing ball code in c language
moveable ball in output
1 Answer
+ 3
I know how to make it but that's out dated .
For making a bouncing ball animation in c++ you need to include the graphics.h library and then you need to use the function :
circle(x,y,FILL);
To create a ball and then put it inside a loop to make it bounce or you can even use recursion to make it much easier and efficient.
Set two variables for x and y for the position of the ball.
create a box using the function :
rectangle(from_x,from_y,to_x,to_y);
and set a proper width .
Then use the algorithm of the bouncing ball.