Skip to content

Instantly share code, notes, and snippets.

@lauslim12
Last active March 9, 2019 11:37
Show Gist options
  • Save lauslim12/e276f58acafbc884fa0c5c5a3fa74114 to your computer and use it in GitHub Desktop.
Save lauslim12/e276f58acafbc884fa0c5c5a3fa74114 to your computer and use it in GitHub Desktop.
Simple fireworks with wishes for new year of 2019.
#!/bin/python3
# first setups
import turtle
name = "Nicholas"
# initialization
scrn = turtle.Screen()
scrn.bgcolor("#000")
scrn.title("New Year 2019!")
scrn.screensize(500, 800)
firework = turtle.Turtle()
firework.pensize(3)
firework.shape("turtle")
size = 20
firework.stamp
firework.speed(100)
firework.left(90)
# first flower
firework.color("#EA2027")
for step in range(40):
firework.forward(100)
firework.left(180)
firework.forward(100)
firework.left(9)
# second flower
firework.color("#EE5A24")
for step in range(36):
firework.forward(130)
firework.left(180)
firework.forward(130)
firework.left(10)
# third flower
firework.color("#F79F1F")
for step in range(20):
firework.forward(150)
firework.left(180)
firework.forward(150)
firework.left(18)
# finishers
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 2019, " + str(name) + "!", True, align="center", font=("Monsterrat", 14, "normal"))
text.setpos(0, -260)
text.write("Best wishes for the next year!", True, align="center", font=("Monsterrat", 12, "normal"))
text.setpos(0, -280)
text.write("Sukses kuliahnya dan jangan nyerah yaa!!", True, align="center", font=("Monsterrat", 12, "normal"))
scrn.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment