CSC 111: Introduction to Computer Science

Lab 4: Bouncing Shapes

Thursday, Feb 17, 2011

Create Animated Bouncing Shape(s)

For the lab this week, try Pair Programming. A short article on Pair Programming, with some sections strategically highlighted, is available here.

Your lab project is to write a program that creates and graphs a very simple bouncing shape. Include the following in your program design:

One way to start framing out your program (much as you always outline a paper before writing!), is to write in the parts you know you'll need, and include comments to set up your program flow. One initial example of this is
# Your header comments
 
from graphics import *
from random import *
from time import *

def main():
    # Create and label graphics window, and setCoords()

    # Generate random starting position 

    # Draw shape in starting position

    # Use 'for' loop to create the bounces of the shape


main()

A possible solution for a jumping, or bouncing ball:

BallJump.py