Due Date: October 4, 2024
Growing Flower Animation
Original program: (100 points)
Objective:
Write a Python program using the turtle
module to create a flower that starts as a small
bud and gradually opens up, with petals unfolding.
The flower should have multiple
layers of petals and include leaves that grow around the stem.
Requirements:
The flower must start as a closed bud and slowly open up.
The petals should unfold layer by layer.
Include a stem that extends downward from the flower.
Two leaves should grow on opposite sides of
the stem as the flower blooms.
You can add as many layers of petals as you
like to create an attractive animation.
Hints:
You can use loops to draw the petals and make
them gradually appear larger with each iteration.
Use the turtle.circle() method to draw the petals
in different sizes.
The turtle.setheading() method can help with
orienting petals in different directions.
Control the animation speed with the turtle.speed() function.
Use the turtle.tracer() and turtle.update()
methods to manage the animation flow.
Example Output:
The flower begins as a small circle (bud).
The petals unfold in a circular pattern, gradually expanding.
A green stem grows down from the flower.
Two green leaves grow on either side of the stem as
the animation progresses.
Explanation:
Petals: The draw_flower() function creates a layered flower
with multiple petals. Each layer's angle is slightly
shifted to create the effect of multiple layers.
Stem: The draw_stem() function extends a simple green
line downward to represent the stem.
Leaves: The draw_leaves() function grows two leaves on
opposite sides of the stem by drawing circles in a specific arc.
Animation: The turtle.tracer(0, 0) and turtle.update()
methods are used to manage animation speed and fluidity.
You can adjust the number of petals, layers, or leaf
size to experiment with different flower designs.
Modification you have to make for me.
-No modification at this time.
Code for the program below:
Run the program
python3 PX_Flower_lastname.py
Your files to turn in:
- After you code and run your program you need to produce the follow artifacts.
PX_Flower_lastname.png (Screen Print of the python program in the Kali)
PX_Flower_lastname (Google Drive document)
PX_Flower_lastname.py (Actual python program)
PX_Flower_lastname.mp4 (Video of python program running)
Drop off your up to 4 files into google classroom.
Due Date: October 2, 2024
Pendulum Motion
(note: copying my code and getting to run will only
get you a 100.
Original program: (100 points)
Features:
-Simulate a swinging pendulum using Turtle graphics.
-You can animate the pendulum as it swings back
and forth, gradually slowing down due
to 'air resistance' or continue indefinitely.
Key Points:
length: Determines the length of the pendulum.
angle: Sets the initial displacement angle of the pendulum.
damping: Controls the air resistance effect (value less than
1 slows down the pendulum over time).
This program uses turtle to animate
the pendulum swinging, and screen.ontimer
ensures the simulation runs continuously.
Adjust length, angle, damping, and dt as
needed to fine-tune the pendulum's behavior.
Modification you have to make for me.
-No modification at this time.
-Click here and run the video of this program
running.
Code for the program below:
Run the program
python3 PX_Pendulum_lastname.py
Your files to turn in:
- After you code and run your program you need to produce the follow artifacts.
PX_Pendulum_lastname.png (Screen Print of the python program in the Kali)
PX_Pendulum_lastname (Google Drive document)
PX_Pendulum_lastname.py (Actual python program)
PX_Pendulum_lastname.mp4 (Video of python program running)
Drop off your up to 4 files into google classroom.
Due Date: September 30, 2024
Spiraling Firework
Assignment fireworks that shoots up from the bottom,
explodes, and creates spiraling patterns with multiple colors.
The spirals can slowly fade away,
giving the effect of a real firework.
(note: copying my code and getting to run will only
get you a 90. You must compete the modification
to get a 100.)
Original program: (90 points)
Features:
-The firework shoots up from the bottom of the screen.
-It explodes into multiple colored particles.
-The particles create a spiraling effect as they move outward.
-The colors of the particles gradually fade away to simulate the firework fading.
Notes:
The colorsys library is used to generate random colors in the HLS color space.
You can adjust num_particles, step, and angle values to change the spiral's appearance.
The screen.tracer(0) and screen.update() combination ensures smoother animation.
Modification you have to make for me.
-You need to have the fireworks fade. (10 Points)
See sample image below:
Code for the program is below:
Run the program
python3 PX_FireWorks_lastname.py
Your files to turn in:
After you code and run your program you need to produce the follow artifacts.
PX_FireWorks_lastname.png (Screen Print of the python program in the Kali)
PX_FireWorks_lastname (Google Drive document)
PX_FireWorks_lastname.py (Actual python program)
PX_FireWorks_lastname.mp4 (Video of python program running)
Drop off your up to 4 files into google classroom.
-Locate your Cyber Range Passwords below by seat number.
Cyber Range Sign on ids and passwords (Period 7)
Click here and get your id and password.
Click here for your cyber range.
https://apps.cyber.org/login
Note: To copy and paste between the Linux virtual enviroment and you windows
enviroment. You need to use Ctrl Shift Alt.
Python Turtle Animation Ideas
• 1. Bouncing Ball Animation - Create a simple animation of a ball that bounces off the edges of the screen. You can add gravity and simulate different speeds for more realism.
• 2. Spiraling Firework - Animate a firework that shoots up from the bottom, explodes, and creates spiraling patterns with multiple colors. The spirals can slowly fade away, giving the effect of a real firework.
• 3. Pendulum Motion - Simulate a swinging pendulum using Turtle graphics. You can animate the pendulum as it swings back and forth, gradually slowing down due to 'air resistance' or continue indefinitely.
• 4. Growing Flower Animation - Create a flower that starts as a bud and gradually opens up, with petals unfolding. You can add multiple layers of petals and even add leaves growing around the stem.
• 5. Moving Car on a Road - Design a simple car that drives along a road. The car can change lanes, go around curves, or stop at a traffic light. You can add other elements like trees, clouds, and houses for a more dynamic scene.
• 6. Flying Butterfly - Animate a butterfly with moving wings that flies around the screen. You can create a path for the butterfly to follow and add some randomness to its movement to mimic a real butterfly.
• 7. Falling Snowflakes - Create an animation where snowflakes fall from the top of the screen. Each snowflake can have a random speed, size, and path, giving the appearance of a winter scene.
• 8. Spinning Windmill - Animate a windmill with rotating blades. You can vary the speed of the windmill based on 'wind strength' and change directions for a more dynamic effect.
• 9. Clock Animation - Create a functioning analog clock with moving hands for seconds, minutes, and hours. You can even add a ticking sound for each second.
• 10. Rotating Solar System - Simulate a simple solar system with planets orbiting around the sun. You can include multiple planets with different sizes, speeds, and orbital paths.
• 11. Shooting Star Animation - Draw a night sky with stars and add shooting stars that streak across the screen at random intervals. You can create a twinkling effect by adjusting the brightness of the stars.
• 12. Waving Flag - Animate a flag waving in the wind. You can achieve this by simulating the flag’s fabric using sine wave functions to create the waving effect.
• 13. Snake Game - Create a simple Snake game using Turtle graphics. The snake can grow as it eats 'food,' and you can animate the movement as the player controls it.
• 14. Fish Swimming in a Pond - Draw a pond scene with animated fish swimming around. The fish can change direction, speed, and even have bubbles rising to the surface.
• 15. Animated Star Patterns - Create a program that draws star patterns with Turtle while continuously changing their positions, sizes, and colors, making it look like they’re twinkling in the sky.