Custom Search

PYTHON: A Turtle Graphics Project

A Remembrance Greeting

A Poppy (October 2022)

 

This is a tribute to the fallen in the wars and conflicts throughout the world, and also to those injured, physically or mentally because of conflict.

It builds upon the drawing of ellipses, and it also incorporates a 'method'. Defining a method with variable inputs that you can give values to when calling it, can be a very useful way of repeating actions efficiently.

# import packages needed in the program

import turtle

#Set variables to zero - always a good idea to have all of your variables together in one place - helps you not to use a value more than once.

x=0

y=0

count=0

radius=0

#Set up screen

screen=turtle.Screen()

screen.setup(500,500)

screen.bgpic("poppydayLWF.png")

screen.addshape("fuzzlered60.png")

screen.addshape("poppyLeaf2.png")

#Set Fuzzle as turtle

fuzzle = turtle.Turtle("fuzzlered60.png")

fuzzle.shape("fuzzlered60.png")

fuzzle.width(5)#set width of drawn line

fuzzle.up

# method to draw poppy

def poppy(radius,x,y): #radius of arc and positions to be defined

fuzzle.goto(x,y)

fuzzle.down()

fuzzle.begin_fill()

for count in range(2):

# draw two arcs for the petals

fuzzle.color("darkred")

fuzzle.fillcolor("red")

fuzzle.circle((radius/2),90)#This draws an arc that is a quarter of a circle radius 'radius/2'

fuzzle.circle(radius,90)#This draws an arc that is a quarter of a circle radius 'radius'

fuzzle.circle((radius/2),90)#This draws an arc that is a quarter of a circle radius 'radius//2' (floor division ensuring a whole number is obtained)

fuzzle.right(90)

fuzzle.up()

fuzzle.goto(-65,-50)

fuzzle.end_fill()

fuzzle.seth(-37)

# draw the centre of the poppy

fuzzle.down()

fuzzle.begin_fill()

fuzzle.color("black")

fuzzle.fillcolor("#111111")

fuzzle.circle(35)

fuzzle.end_fill()

#draw stalk

fuzzle.up()

fuzzle.goto(30,-103)

fuzzle.down()

fuzzle.color("green")

#Make Fuzzle rest upright on bottom line

fuzzle.seth(-210)

fuzzle.circle(250,-30)

fuzzle.up()

# Main section

poppy(150,30,-100)#Here we call on the 'poppy' method

fuzzle.goto(70,-220)

fuzzle.seth(450)

#Set Leaf image as a turtle to use in the graphic

Leaf = turtle.Turtle("poppyLeaf2.png")

Leaf.up()

Leaf.shape("poppyLeaf2.png")

Leaf.goto(170,-96)

Leaf.right(270)

Here is the result - do also read the poem after the animation...

 

With proud thanksgiving, a mother for her children,
England mourns for her dead across the sea.
Flesh of her flesh they were, spirit of her spirit,
Fallen in the cause of the free.

Solemn the drums thrill: Death august and royal
Sings sorrow up into immortal spheres.
There is music in the midst of desolation
And a glory that shines upon our tears.

They went with songs to the battle, they were young,
Straight of limb, true of eye, steady and aglow.
They were staunch to the end against odds uncounted,
They fell with their faces to the foe.

They shall grow not old, as we that are left grow old;
Age shall not weary them, nor the years condemn.
At the going down of the sun and in the morning
We will remember them.

They mingle not with their laughing comrades again;
They sit no more at familiar tables at home;
They have no lot in our labour of the day-time;
They sleep beyond England's foam.

But where our desires are and our hopes profound,
Felt as a well-spring that is hidden from sight,
To the innermost heart of their own land they are known
As the stars are known to the Night;

As the stars that shall be bright when we are dust,
Moving in marches upon the heavenly plain,
As the stars that are starry in the time of our darkness,
To the end, to the end, they remain.

Written in August 1914

by Robert Laurence Binyon (10 August 1869 – 10 March 1943)