University of Maryland Baltimore County Turtle Painting Custom Graphics
Description
create a custom turtle graphics painting. The specifications for this project are intentionally loose as I want you to experiment with using the turtle graphics library. Here’s what I’m looking for, but keep in mind the items below represent the minimum requirements for this assignment–feel free to add additional items to your scene!
- Select a landscape scene that you would like to draw using turtle graphics. This can be a simple forest scene, mountain scene, even an outer space scene – it’s up to you!
- Import the turtle graphics module and set up your turtle canvas using the turtle.setup() function (see the lecture slides and our course website for some sample code to get you started). Note: Do not name your program “turtle.py”! This will conflict with the module name that you are importing.
- Fill the background with a solid color other than white (hint: draw a filled box on your canvas before you draw anything else)
- Create at least 5 different shapes (other than the background color from step #3) for your scene. For example, if you wanted to create a forest scene, you could create clouds, trees, a stream, the sun and some mountains for the background. Each shape MUST be written using a function that accepts at least one or more argument(s). You cannot simply call turtle commands from your main program for your shapes – every object should be rendered using its own function. For example, if you wanted to draw a tree you could write a function that looks like the following:# tree() function # input: x and y coordinates (integers) # processing: draws a tree at the x, y coordinates specified # output: returns nothing to the caller def tree(x, y): # draw your tree at the position x, y on the screen
This means that you will need to write at least 5 custom functions for this project. You may want to place these in a module to make your code easier to read (suggested though not required) - Test each function independently to make sure it works the way you want it to work. For example, you can simply call your tree() function to draw a tree to make sure it behaves correctly without having to worry about your other shapes.
- Comment each function heavily. Use IPO (Input Processing Output) notation to describe what kinds of arguments the function expects, what it does and what it returns to the calling program (if anything – most of your functions for this project won’t return a value)
- At least one of your shapes should be inside a loop that creates at least 5 copies of that shape at different areas of the screen.
- Design your program so that the user can interact with it using the
turtle.textinput()
function. For example, you could design your program so that it prompts the user with a series of questions (i.e. how many trees should I draw?) and then draw the desired output.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."