This will bounce a ball off the walls inside our phone. It's simple, but fun to watch. Here we go:
1. Drop a Canvas on the virtual phone screen in Design. Make its width Fill Parent, but do not worry about height (we'll fix that in Blocks Editor).
2. Drop a Ball onto the Canvas.
3. In the Properties column with the Ball selected (as in the next screenshot), change the Interval parameter to
60
(the default of1000
is too jerky,60
is much smoother). Interval is the time, in milliseconds, between movements.4. Set the Radius (size) to
30
and the speed to50
.
That's it for the design of our bouncy ball. Don't worry that the ball rolled over to one side and hung up—we still have to build our blocks for proper operation.
After we get the ball bouncing right, come back and play with the previous settings and observe the actions of the ball. That's the fastest way of learning how this basic animation works.
Now we go to the Blocks Editor and pull together blocks so that...