-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGratitude.py
More file actions
66 lines (56 loc) · 1.45 KB
/
Copy pathGratitude.py
File metadata and controls
66 lines (56 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import turtle
import time
# Set up the screen
screen = turtle.Screen()
screen.title("Thank You ISRO!")
screen.bgcolor("black") # Space-like background
# Create a turtle object for drawing
pen = turtle.Turtle()
pen.speed(3)
pen.color("white")
pen.hideturtle()
# Function to write text
def write_message(message, font_size, x, y):
pen.penup()
pen.goto(x, y)
pen.pendown()
pen.write(message, align="center", font=("Arial", font_size, "bold"))
# Draw the gratitude message
write_message("Thank You ISRO!", 24, 0, 100)
write_message("For Inspiring the World with Your Space Missions!", 16, 0, 50)
# Create a turtle for the rocket
rocket = turtle.Turtle()
rocket.speed(3)
rocket.color("orange")
rocket.shape("triangle")
rocket.shapesize(2, 1)
rocket.penup()
rocket.goto(0, -100)
# Draw a simple Earth at the bottom
earth = turtle.Turtle()
earth.speed(0)
earth.color("blue")
earth.penup()
earth.goto(0, -200)
earth.pendown()
earth.begin_fill()
earth.circle(50)
earth.end_fill()
earth.hideturtle()
# Add some green patches on Earth
for _ in range(3):
earth.penup()
earth.goto(0 + _ * 10, -200 + _ * 5)
earth.pendown()
earth.color("green")
earth.begin_fill()
earth.circle(10)
earth.end_fill()
# Animate the rocket moving upwards
for i in range(50):
rocket.goto(0, -100 + i * 5)
time.sleep(0.05)
# Add a final message
write_message("Proud of Your Achievements!", 14, 0, -50)
# Keep the window open until clicked
screen.exitonclick()