# Maria Mauco
# 6/10/2024
# Pygame intro

# Initialize pygame
import pygame, sys
from pygame.locals import *

pygame.init()

# Colors!
white = pygame.Color(255,255,255)
purple = pygame.Color(250,10,250)
green = pygame.Color(10,250, 10)
yellow = pygame.Color(255,255,0)

# Store our window
DISPLAYSURF = pygame.display.set_mode((700,500))
pygame.display.set_caption('This is my title!!!!')

# Rectangle variables
widthRect = 100
lengthRect = 200
xRect = 700/2 - (widthRect/2)
yRect = 500/2  - (lengthRect/2)

# Circle
xCircle = 700/2
yCircle = 500/2
radius = widthRect /2

# Triangle variables
triangleLen = 50
startx = 700/2 + 100 + triangleLen
starty = 500/2 - (triangleLen/2)
endx = startx + triangleLen
endy = starty + triangleLen




# Game loop
while True:

    # Handle events
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
                

    # Make background white
    DISPLAYSURF.fill(white)

    pygame.draw.rect(DISPLAYSURF, purple,(xRect,yRect, widthRect,lengthRect), 5)


    pygame.draw.circle(DISPLAYSURF,green, (xCircle,yCircle), radius, 5)

    # Draw triangle
    pygame.draw.line(DISPLAYSURF, yellow, (startx,starty), (endx,endy), 5)
    pygame.draw.line(DISPLAYSURF,yellow, (endx,endy), (endx - (triangleLen*2), endy), 5)
    pygame.draw.line(DISPLAYSURF, yellow, (endx - (triangleLen*2), endy), (startx,starty), 5)

    pygame.display.update()
    
