CPSC120A
Fundamentals of Computer Science I

Lab 11

Animation

Use the command line to create a new directory called lab11 in your labs directory. Make sure all of the .py files that you create for this activity are in that directory.

Moving

Create a Python function called animate_moving(sprite, delta_x, delta_y, number_of_frames) in a file called moving.py. The function should use Pygame and recursion to animate a sprite moving. The sprite parameter should specify the sprite that should be animated. The delta_x and delta_y parameters should specify the number of pixels the sprite should move in the x and y directions for each frame of animation. The number_of_frames parameter should specify how many frames there are in the animation. You can use the following image to test your program or you can find your own on-line.

Walking

Create a Python function called animate_walking(sprite, number_of_frames) in a file called walking.py. The function should use Pygame and recursion to animate a character walking. The sprite parameter should specify the sprite that should be animated. The number_of_frames parameter should specify how many frames there are in the animation. The walking animation should consist of alternating between two different images of a walk cycle. Your program can use the following images or you can find your own on-line.

Design Document

Create a design document for your assignment 3 program, on paper. The functionality of the program is limited by the assignment requirements, and determining the structure of the program is part of the assignment. So the design document should only include a storyboard of the program's animation. The storyboard should consist of multiple drawings, like a comic strip, with arrows to illustrate the animation in each cell.

Please give me your design document before beginning work on the assignment.

Submission

Please show your source code and run your programs for the instructor or lab assistant. Only a programs that have perfect style and flawless functionality will be accepted as complete.