diff --git a/.commit_template b/.commit_template index 6686441..ca9c82f 100644 --- a/.commit_template +++ b/.commit_template @@ -1,6 +1,7 @@ -My first commit will consist of my first milestone. Not necessarily what has been changed but what has been thought. My idea for this project was to create a house and a snowball but soon began to feel less confident with the ability to animate it. So then, I came to the conclusion that I will create a house and a rising sun for my project proposal. +My second commit will consist of my second round of changes. What has changed is +my functions in drawing.py and shapes.py have been updated to show a house and sun. -Where I was first stuck was my idea for a project proposal. My original ideas seemed to be a bit more complicated as a first project and I thought of a simpler idea of creating a house and a rising sun. I figured out my project proposal. A strategy I used to get un-stuck was looking at simple project ideas and using my own environment to see what I can use as a simple project proposal. Something I wondered was "how can I get the sun to rise on one side and set on the other?". I soon decided to just keep the sun as a rising sun. What I want to learn more about is animating using code and a future idea for a project could be making a house with an animated sun rising on one side of the house and then setting on the other side of the house. +What got me stuck in the beginning is figuring out where to begin. It was an easy fix because I used the previous assignments to help me with making shapes using various parameters. I figured out that the previous lessons still prove to be a great help to look back at when stuck. I was specifically stuck with the animation of the sun rising. A different method was used to create a rising sun but was outside of the realm of super turtle which ultimately had me back track. It took longer to try and learn animation with super turtle so I reached out to my professor and decided I will continue with my house but the sun will be stationary rather than rising. Something I want to learn more about is animating using super turtle. An idea for a future project will be to create a house and a rising sun using the tools of super turtle. # ----------------------------------------------------------------- # Write your entire commit message above this line. diff --git a/README.md b/README.md index 3b8d5e2..6e3e1ea 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ I want to write square(), rectangle(), triangle() and circle() functions for the ### Milestone 2 -I want to ombine my functions to create a house and a sun with color. Then I want to create a function that will give my sun a rising movement which will create a rising sun. To do this I will create a drawing.py file where the movement of my sun will be stored. +I want to combine my functions to create a house and a sun with color. Then I want to create a function that will give my sun a rising movement which will create a rising sun. To do this I will create a drawing.py file where the movement of my sun will be stored. ### Milestone 3 diff --git a/__pycache__/shapes.cpython-313.pyc b/__pycache__/shapes.cpython-313.pyc index 61caf4f..4418555 100644 Binary files a/__pycache__/shapes.cpython-313.pyc and b/__pycache__/shapes.cpython-313.pyc differ diff --git a/drawing.py b/drawing.py index 145390d..ca1f815 100644 --- a/drawing.py +++ b/drawing.py @@ -4,26 +4,58 @@ # # (Briefly describe what this program does.) -from turtle import * - import turtle -import time from shapes import draw_square, draw_triangle, draw_rectangle, draw_circle # setup screen = turtle.Screen() screen.setup(width=800, height=600) screen.bgcolor("skyblue") -screen.tracer(0) pen = turtle.Turtle() pen.speed(0) pen.hideturtle() - +# draw house def draw_house(): - + # house base + pen.penup() + pen.goto(-100, -200) + pen.pendown() + draw_square(pen, 200, color="black", fill="lightgrey") + # roof (lowered) + pen.penup() + pen.goto(-100, -200) + pen.pendown() + draw_triangle(pen, 200, color="black", fill="brown") -def animate_sun(): - + # door + pen.penup() + pen.goto(-30, -200) + pen.pendown() + draw_rectangle(pen, 60, 100, color="black", fill="darkred") + + # windows (lowered) + pen.penup() + pen.goto(-80, -210) + pen.pendown() + draw_square(pen, 40, color="black", fill="lightblue") + + pen.penup() + pen.goto(40, -210) + pen.pendown() + draw_square(pen, 40, color="black", fill="lightblue") + +# draw sun (stationary) +def draw_sun(): + pen.penup() + pen.goto(250, 180) # top-right corner + pen.pendown() + draw_circle(pen, 50, color="black", fill="yellow") + +# main +draw_house() +draw_sun() + +turtle.done() \ No newline at end of file diff --git a/shapes.py b/shapes.py index 1e15e4e..7c23fd3 100644 --- a/shapes.py +++ b/shapes.py @@ -1,13 +1,41 @@ import turtle def draw_square(t, size, color="black", fill=""): - + t.color(color, fill) + if fill: + t.begin_fill() + for _ in range(4): + t.forward(size) + t.right(90) + if fill: + t.end_fill() def draw_rectangle(t, width, height, color="black", fill=""): - + t.color(color, fill) + if fill: + t.begin_fill() + for _ in range(2): + t.forward(width) + t.right(90) + t.forward(height) + t.right(90) + if fill: + t.end_fill() def draw_triangle(t, size, color="black", fill=""): - + t.color(color, fill) + if fill: + t.begin_fill() + for _ in range(3): + t.forward(size) + t.left(120) + if fill: + t.end_fill() def draw_circle(t, radius, color="black", fill=""): - + t.color(color, fill) + if fill: + t.begin_fill() + t.circle(radius) + if fill: + t.end_fill() \ No newline at end of file