Moving an Object
|
ASSIGNMENT:
Click on the canvas area several times to discover what behavior is produced
by clicking. Inspect the code carefully. Be able to answer these questions:
- What are the maximum and minimum values of loc?
- What are the possible values of d?
- Why doesn't the circle move vertically?
- What would it take to make the circle move vertically?
Change the behavior of this applet so that two small squares move diagonally
from corner to corner. One will move from upper-left to lower-right and he
other from lower-left to upper-right. Make each small square a different
color.
|