*********
*********

Resize images

Due Date: October 22, 2024

Click here to complete your assignment.

*********
*********

Flying Butterfly Animation - Python Program Description

Due Date: October 24, 2024

This document provides a description of the Python Turtle program that animates a butterfly with moving wings. The butterfly flies around the screen following a random path, with its wings flapping up and down to mimic real butterfly movements.

Key Features of the Program:

How to Run the Program:

To run this program, you'll need Python installed along with the Turtle module.
Save the program code to a .py file and run it to see the butterfly animation.

Your file name is PX_lastname_ButterFly.py Original program value: (100 points) Source Code:
Program Part 1
Program Part 2
Program Part 3

Sample output image:
Program Part 1


Falling Snowflakes - Python Program Description

Due Date: October 28, 2024

This program animates falling snowflakes using Python's Turtle module. Each snowflake falls from the top of the screen with a random speed, size, and path, simulating a winter scene.

Key Features:

How the Program Works:

The Turtle module provides graphical functionality. The screen is set up to be 800x600 pixels with a dark blue background to represent a night sky.

The snowflake objects are created from a custom class Snowflake. Each object is positioned at random starting points at the top of the screen and begins falling with random attributes like speed, size, and horizontal drift.

The main animation loop continually updates the snowflake positions on the screen. When a snowflake reaches the bottom, it is reset to the top, maintaining an endless winter snowfall effect.

You can modify this program by changing the number of snowflakes, their speed, and even adding other elements such as wind effects or snow accumulation.

I put your program out of order. This is a puzzle to put together.
Look at your prior assignments.
They are similar to this one.

# Create a class for Snowflake
# Create a number of snowflakes
# Keep the window open
# List to hold snowflakes
# Main loop to animate the snowflakes
# Reset snowflake to the top once it falls below the screen
# Run the animation
# Setup the screen
animate_snowflakes()
class Snowflake(turtle.Turtle):
def __init__(self):
def animate_snowflakes():
def fall(self):
for _ in range(50):
for snowflake in snowflakes:
if self.ycor() < -300:
import random
import time
import turtle
new_x = self.xcor() + self.drift
new_y = self.ycor() - self.speed_y
screen = turtle.Screen()
screen.bgcolor("darkblue")
screen.mainloop()
screen.setup(width=800, height=600)
screen.title("Falling Snowflakes")
screen.tracer(0) # Turn off automatic updates for smooth animation
screen.update() # Update the screen for smooth animation
self.color("white")
self.drift = random.uniform(-1, 1) # Random horizontal drift
self.goto(new_x, new_y)
self.goto(random.randint(-390, 390), random.randint(250, 400))
self.goto(random.randint(-390, 390), random.randint(250, 400))
self.penup()
self.shape("circle")
self.shapesize(stretch_wid=self.size, stretch_len=self.size)
self.shapesize(stretch_wid=self.size, stretch_len=self.size)
self.size = random.uniform(0.5, 1.5)
self.size = random.uniform(0.5, 1.5) # Reset size
self.speed(0)
self.speed_y = random.uniform(1, 3) # Random speed for each snowflake
self.speed_y = random.uniform(1, 3) # Reset speed
snowflake = Snowflake()
snowflake.fall()
snowflakes = []
snowflakes.append(snowflake)
super().__init__()
time.sleep(0.02) # Control the speed of animation
while True:

Your file name will be PX_Lastname_snowflakes.

Files to Submit
• PX_snowflakes_lastname.png (Screenshot of the program)
• PX_snowflakes _lastname (Google Drive document)
• PX_snowflakes _lastname.py (Actual Python program)
• PX_snowflakes _lastname.mp4 (Video of the program running)

Drop off your 4 files into Google Classroom.