Bouncy Ball


In this assignment, you will alter the AnimatedBall app so that it the ball bounces off the edges of the phone.  Although the Ball has a "bounce" function defined, you will be implementing bounce behavior from scratch.

This app uses if-then-else conditionals.


  1. Add two variables, XDelta & YDelta.  Set the initial values to 20. Alter your Ball.MoveTo block to add XDelta and YDelta instead of the number 20.  Check program still works. Hint
  2. Alter the event-handler that calls Ball1.MoveTo to check the ball's location and change XDelta or YDelta if the ball is near the edge. These checks should occur before the Ball1.MoveTo call. Hint