Graphic JavaScript


Back to index
Random Fly

Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:

Make the following alterations to the sample program:

  1. Divide the canvas area into nine equal areas in a 3x3 configuration.
  2. Populate each resulting area with a single fly and have the fly move around within its area in a random manner.
  3. Make each fly a different color and assign the colors for the fly through use of color RGB values stored in an array.