Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Motion [7/10]

This program animates two moving discs. The blue disc moves twice as fast as the red one.
[Run the program]

The disc procedure has the form:
disc(x, y, radius, color)

Exercises:

  1. Change the arguments 200 and 300 in disc procedure calls to some other values in the range from 0 to 700.

  2. Set the second argument of the blue disc call to expression 2*i to make the blue disc move diagonally.

  3. Set the third argument of the red disc call to expression i/2 to make the red disc grow in size.

  4. Change the argument of the sleepMs call to value 500.

Loading...