# Arup Guha
# 6/11/2022
# Drawing in pygame
# https://www.pygame.org/docs/ref/draw.html

import pygame, sys
from pygame.locals import *

# Here we set how big our display is and the caption.
pygame.init()
DISPLAYSURF = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Drawing!")

# I am just creating some colors to use.
white = pygame.Color(255,255,255)
black = pygame.Color(0,0,0)
red = pygame.Color(255,0,0)
green = pygame.Color(0,255,0)


# This is what we call a game loop, it just runs till we exit on an event where
# we click the top left corner.
while True:

    # We just need this to quit gracefully.    
    for event in pygame.event.get():        
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

    # I will fill the surface with black at first.
    DISPLAYSURF.fill(white)

    # A circle is a type of ellipse, so this is a red circle. When we set
    # the thickness to 0, it fills it in.
    pygame.draw.ellipse(DISPLAYSURF, red, (350, 250, 100, 100), 0)

    # Now, I will draw a ring around the first circle with thickness 5.
    pygame.draw.ellipse(DISPLAYSURF, red, (300, 200, 200, 200), 5)

    # Now I will draw a rectangle in green around the outer circle.
    pygame.draw.rect(DISPLAYSURF, green, (298, 198, 204, 204), 2)

    # This is a forward diagonal line. 
    pygame.draw.line(DISPLAYSURF, black, (0, 496), (496, 0), 1)

    # This is a forward diagonal line. 
    pygame.draw.line(DISPLAYSURF, black, (302, 600), (800, 102), 1)

    # This updates the display.
    pygame.display.update()
