-
Notifications
You must be signed in to change notification settings - Fork 0
/
newyearwish.py
70 lines (56 loc) · 1.42 KB
/
newyearwish.py
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
67
68
69
70
import turtle
from pygame import mixer
# Adding music is optional as per your choice.
# Initialize pygame mixer
mixer.pre_init(frequency=48000, size=-16, channels=2, buffer=512)
mixer.init()
mixer.music.load("sound.mp3") #add your music file name or path
screen = turtle.Screen()
screen.bgcolor('#000')
screen.title("Happy new year 2024")
screen.screensize(800,800)
mixer.music.play()
firework = turtle.Turtle()
firework.pensize(3)
firework.shape('turtle')
size = 20
firework.stamp
firework.speed(11)
firework.left(90)
firework.color("#EA2027")
for step in range(40):
firework.forward(100)
firework.left(180)
firework.forward(100)
firework.left(9)
firework.color('#EE5A2A')
for step in range(36):
firework.forward(130)
firework.left(180)
firework.forward(130)
firework.left(10)
firework.color('#F79F1F')
for step in range(20):
firework.forward(150)
firework.left(180)
firework.forward(150)
firework.left(18)
firework.color('#3ae374')
for stamps in range(12):
firework.penup()
firework.forward(170)
firework.pendown()
firework.forward(10)
firework.penup()
firework.forward(10)
firework.stamp()
firework.right(30)
firework.penup()
firework.setpos(0,0)
text = turtle.Turtle()
text.color("#fff")
text.penup()
text.setpos(0,-240)
text.write("Happy New Year 2024", True, align="center", font=("Monsterrat", 20, "normal"))
text.setpos(0,-260)
screen.mainloop()