Custom Search

PYTHON: A Turtle Graphics Project

A Snowman

(December 2022)

import turtle
count=0
#set up screen
screen=turtle.Screen(500,500)
screen.bgcolor("#123456")
# set the screen background
screen.bgpic("snow.png")
#add graphics for cursor
screen.addshape("fairySihouettewhite.png")#add the cursor
fairy = turtle.Turtle("fairySihouettewhite.png")
#draw body
fairy.up()
fairy.goto(0,-150)
fairy.color("white")
fairy.shape("fairySihouettewhite.png")
fairy.fillcolor("#FFFFFF")
fairy.down()
fairy.begin_fill()
fairy.circle(70,360)
fairy.end_fill()
#draw head
fairy.up()
fairy.goto(0,-18)
fairy.begin_fill()
fairy.circle(40,360)
fairy.end_fill()
#draw hat
fairy.up()
fairy.goto(-30,50)
fairy.color("black")
fairy.fillcolor("#000000")
fairy.down()
fairy.begin_fill()
while count<4:
fairy.forward(60)
fairy.lt(90)

count=count+1
else:
fairy.end_fill()
count=0
fairy.width(5)
fairy.backward(30)
fairy.forward(120)
fairy.up()
#draw eyes
fairy.goto(-17,20)
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
fairy.goto(17,20)
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
#draw nose
fairy.width(2)
fairy.goto(0,5)
fairy.color("orange")
fairy.fillcolor("orange")
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
#draw mouth
fairy.width(4)
fairy.goto(-18,-5)
fairy.color("black")
fairy.fillcolor("black")
fairy.down()
fairy.circle(2,360)
fairy.up()
fairy.goto(-11,-7)
fairy.down()
fairy.circle(2,360)
fairy.up()
fairy.goto(-4,-8)
fairy.down()
fairy.circle(2,360)
fairy.up()
fairy.goto(3,-8)
fairy.down()
fairy.circle(2,360)
fairy.up()
fairy.goto(10,-7)
fairy.down()
fairy.circle(2,360)
fairy.up()
fairy.goto(18,-5)
fairy.down()
fairy.circle(2,360)
fairy.up()
#draw buttons
fairy.width(2)
fairy.goto(0,-45)
fairy.color("orange")
fairy.fillcolor("orange")
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
fairy.goto(0,-85)
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
fairy.goto(0,-125)
fairy.down()
fairy.begin_fill()
fairy.circle(6,360)
fairy.end_fill()
fairy.up()
#draw left arm
fairy.goto(-60,-70)
fairy.down()
fairy.rt(225)
fairy.width(5)
fairy.color("#663300")
fairy.forward(100)
fairy.width(2)
fairy.goto(-150,0)
fairy.up()
fairy.goto(-130,0)
fairy.down()
fairy.rt(90)
fairy.forward(20)
fairy.up()
fairy.goto(-130,0)
fairy.down()
fairy.rt(-40)
fairy.forward(30)
fairy.up()
fairy.goto(-130,0)
fairy.down()
fairy.rt(-80)
fairy.forward(30)
fairy.up()
#draw right arm
fairy.goto(60,-70)
fairy.down()
fairy.lt(245)
fairy.width(5)
fairy.forward(100)
fairy.width(2)
fairy.goto(130,10)
fairy.up()
fairy.goto(130,10)
fairy.down()
fairy.lt(90)
fairy.forward(20)
fairy.up()
fairy.goto(130,10)
fairy.down()
fairy.lt(-40)
fairy.forward(30)
fairy.up()
fairy.goto(130,10)
fairy.down()
fairy.lt(-80)
fairy.forward(30)
fairy.up()
fairy.goto(-170,-150)
fairy.lt(810)
#Greeting
screen.addshape("MerryXmas.png")#add text message
text = turtle.Turtle("MerryXmas.png")
text.shape("MerryXmas.png")
text.up()
text.rt(630)
text.forward(156)