Files
project_drawing/drawing.py
juddin2 f59b343487 I chnaged my entire code to add superturle animation.
I couldn't draw the windows to my skyscrapers so, i though of using superturtle animation.However, I'm having trouble installing superturle.
I did text my professor using discord about this issue. I have a feeling that I might have to change my intial project idea to something simple.
2025-09-20 19:36:31 -04:00

40 lines
829 B
Python

# drawing.py
# ----------
# By Jannatun Uddin
#
# (Briefly describe what this program does.)
from superturtle.animation import animate
from turtle import forward, left, penup, pendown, fillcolor, begin_fill, end_fill
def draw_building(width, height, color="gray"):
fillcolor(color)
begin_fill()
for i in range(2):
forward(width)
left(90)
forward(height)
left(90)
end_fill()
# Animation loop
for frame in animate(40, loop=True):
brightness = int(frame.interpolate(100, 200, mirror=True))
# First building
penup()
pendown()
draw_building(60, 100, color)
# Second building
penup()
forward(80)
pendown()
draw_building(50, 120, color)
# Third building
penup()
forward(70)
pendown()
draw_building(70, 90, color)
input()