Images and animation

Assignment overview

In this assignment, you will create several simple animations using your newfound function-writing skills. To create an animation, write a Number -> Image function that takes in a frame number and returns the image to be displayed on that frame.

Animations

Please design the following functions, in a file called YourNameAnimations1.rkt. At the end of this document, I’ve provided a list of potentially useful built-in functions. Important note: on your own computer, in order to use animate, you will need to go to the Language menu and select “Add Teachpack.” Select the universe.rkt teachpack.

1Movement and growth

Create three separate animations in which:

2Direction and speed

Create two separate animations in which:

3There and back again

Create three separate animations in which:

4Give a shape a friend

Create an animation in which two shapes are moving independently.

5Bouncing in two directions

Create an animation in which a ball moves diagonally, but at different speeds in each direction (e.g., 2 pixels downward and 4 pixels rightward per frame). When the ball hits the left or right side, it should reverse its horizontal direction; when it hits the top or bottom, its vertical direction should reverse.

6Your own animation

Create any animation you’d like, using built-in shapes or images from the Internet.

Extra Challenge: Sunrise

Create an animation of a sunrise, that goes from the bottom left corner of a screen upward, in a parabola, ending at the bottom right corner.

Useful built-in functions

You may find the following functions useful in completing this assignment: