# square.py

# modified from code in Object-Oriented Python, by Irv Kalb

# a class representing a Pygame square with randomly chosen
# color, size and position. inherits from the Shape class

import pygame
from shape import *

class Square(Shape):
    def __init__(self, window, max_width, max_height):
        super().__init__(window, max_width, max_height)
        self.width_height = random.randrange(10, 100)
        self.rect = pygame.Rect(self.x, self.y,
                                self.width_height, self.width_height)
    
    def draw(self):
        pygame.draw.rect(self.window, self.color,
                         (self.x, self.y, self.width_height, self.width_height))