# Allison Obourn
# CS 115, Autumn 2021
# Lecture 22

# This program draws two birds on a panel. They are horizontal from each other.
# Both are a light bright purple and facing forward.

# NOTE: putting our code to draw the bird in a function that takes parameters
#       means we can use the same drawing code to draw multiple birds. We don't
#       need to repeat all of those lines to draw each bird!

from ECGUI import *

BIRD_WIDTH = 60
BIRD_HEIGHT = 80

    
def main():
    panel = drawing_panel(300, 300)
    bird(panel, 50)
    bird(panel, 200)

# draws a bright purple bird with slightly darker purple wings and a yellow beak
# The bird faces forward and its left side is at the passed in x position on
# on the passed in panel.
def bird(panel, x):
    # all birds currently have the same y position
    y = 50
    panel.fill_oval(x + 5, y, BIRD_WIDTH - 10, BIRD_HEIGHT, "#990099") # body
    panel.fill_oval(x + 40, y + 25, 20, 40, "#770077")                 # wing
    panel.fill_oval(x, y + 25, 20, 40, "#770077")                      # wing
    panel.fill_oval(x + 20, y + 10, 5, 5, "black")                     # eye
    panel.fill_oval(x + 35, y + 10, 5, 5, "black")                     # eye
    panel.fill_rect(x + 28, y + 18, 4, 8, "#eecc00")                   # beak

main()
