MTEC1003 Media Computation Skills Lab

Fall 2023 Wed 6:00-8:30 [ONLINE] Prof. Louis Goldford.

SYLLABUS SCHEDULE SOFTWARE + RESOURCES GRADING

Lab 13 / Part 2: Advanced Canvas

C O N T E N T S

In this lab, you’ll be creating the following programs together in class:

  1. Four By Seven
  2. Checkerboard

You will then have the choice of completing any 2 out of the 4 additional programs on your own:

  1. Checkers Game
  2. Three Circles
  3. Circle Grow
  4. Hemisphere

1. Four By Seven

Name this file 4by7.html. Use 2 loops to make a 4 x 7 grid of light green circles:

4x7 example output


2. Checkerboard

Name this file checkerboard.html. Make a checkerboard that has alternating black and white squares:

checkerboard example output


Complete any 2 of the 4 additional programs below on your own & submit before this week’s deadline:


5. Checkers Game

Name this file checkersgame.html. Using that same checkerboard you made before, place blue and green pieces on the proper squares to start a game:

checkers game example output


6. Three Circles

Name this file threecircles.html. Make 3 concentric circles. The largest has a radius of 100 px and is red. The medium circle has a radius of 75 px and is blue. The smallest circle has a radius of 50 px and is green:

3 circles example output


7. Circle Grow

Name this file circlegrow.html. Use a loop to make a series of 9 or more circles that grow in size with each iteration. The circles should move diagonally, starting in the upper left corner of the canvas and moving to the lower right, ending in the lower right corner, like this:

circle grow example output


8. Hemisphere

Name this file hemisphere.html. Draw the two black and green hemispheres pictured below. Experiment with the last 3 arguments of the context.arc() function. Recall that its standard form is:

context.arc(x, y, radius, 0, 2 * Math.PI, true)

Your hemisphere should look something like this:

circle grow example output


…And that’s it! Now, time to move on to the next part of lab 13…