diff --git a/README.md b/README.md index f1f9465..ff41cb0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # (Drawing project) -I can draw a building with rectangles and triangles. +I can draw a building with rectangles. ## Description -If I can, I want my drawing to be an animation of mutiple buildings lighting up with roads at the side. +If I can, I want my drawing to be an animation of mutiple buildings flickering. ![Description](filename.png) ) @@ -14,6 +14,6 @@ If I can, I want my drawing to be an animation of mutiple buildings lighting up ## Milestone 1 Write a function to draw a building using the width,height, and color. ## Milestone 2 -Add windows in the buildings. +Animate the buildings. ## Milestone 3 -Create another function to try to draw a road. +Fix any error. diff --git a/drawing.py b/drawing.py index 774ef17..7b9b227 100644 --- a/drawing.py +++ b/drawing.py @@ -2,11 +2,12 @@ # ---------- # By Jannatun Uddin # -# (Briefly describe what this program does.) +# (It makes 3 buildings that flicker from dark gray and gets dimmer.Also, if tou look closely at the buildings you can see it get closer too.) from superturtle.animation import animate -from turtle import forward, left, penup, pendown, fillcolor, begin_fill, end_fill +from turtle import forward, left, right, backward, penup, pendown, begin_fill, end_fill, pencolor, fillcolor def draw_building(width, height, color="gray"): + pencolor(color) fillcolor(color) begin_fill() for i in range(2): @@ -16,25 +17,36 @@ def draw_building(width, height, color="gray"): left(90) end_fill() -# Animation loop +# This is an Animation for frame in animate(40, loop=True): - brightness = int(frame.interpolate(100, 200, mirror=True)) + shade = int(frame.interpolate(100, 200, mirror=True)) + color = f"#{shade:02x}{shade:02x}{shade:02x}" - - # First building penup() + backward(200) pendown() - draw_building(60, 100, color) - # Second building + # Building 1 + draw_building(60, 200, color) + + # Building 2 penup() forward(80) pendown() draw_building(50, 120, color) - # Third building + # Building 3 penup() forward(70) pendown() - draw_building(70, 90, color) -input() \ No newline at end of file + draw_building(90, 300, color) + + + + + + + + + +