Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

makeBasicMovie

def makeBasicMovie():

  # making a 100 frames
  for frame in range(1, 100 + 1):

    canvas = makeEmptyPicture(500, 300)

    # adding a background
    addRectFilled(canvas, 1, 1, 500, 300, blue)

    # adding the smaller rectangle and making it move horizontally by 5 pixels
    #addRectFilled(canvas, frame * 5, 1, 50, 50, red)

    # adding the smaller rectangle and making it move diagonally vertically by 5 pixels
    #addRectFilled(canvas, 1, frame * 5, 50, 50, red)

    # adding the smaller rectangle and making it move diagonally by 5 pixels
    addRectFilled(canvas, frame * 5, frame * 5, 50, 50, red)

    # writing the frames to your computer with the proper naming convention
    if frame < 10:    
      writePictureTo(canvas, "frame00" + str(frame) + ".jpg")
    if frame >=10 and frame < 100:
      writePictureTo(canvas, "frame0" + str(frame) + ".jpg")
    if frame == 100:
      writePictureTo(canvas, "frame" + str(frame) + ".jpg")

  # make the movie and plays it
  movie = makeMovieFromInitialFile("frame001.jpg")
  playMovie(movie)



Link to this Page