We create a slider based on worksheet work this week. As moving slider, the area of bouncing ball is changing.
One of the problem is when ball hits the wall (the border). Actually the center point hits the border instead of the border of ball (the circle). But it goes wrong if I change the range in if statement. The origin statement:
if(bx2 > x || bx2 < 0){…}.
change to: if(bx2 > x – 15 || bx2 < 15){…} ()
(15 is the radius of ellipse)
Another bug is that it goes wrong if I move fast the slider across the location of ellipse.