import pygame 
import os 

SCREEN = (640,480)
display = pygame.display.set_mode(SCREEN)

# DD. GAME_OBJECT
# gameObject = GameObject()
# interp. a game object in the editor with:
# - position x and y in the screen, where coordinate is the center of the object
# - image loaded in pygame
# - object_type: agent, wall, enemy, food
class GameObject():
    def __init__(self,position, angle, object_type, img_path):
        self.placed = False #stops following cursor once it's placed
        self.object_type = object_type
        self.image_path = img_path
        self.image = pygame.image.load(img_path)
        self.rect = self.image.get_rect()
        self.rect.center = position
        self.angle = angle
        self.turnClockwise()

        
    def draw(self, display):
        display.blit(self.image, self.rect)
        
    def turnClockwise(self, degrees=0):
        # Preserve the current center position of the rectangle
        self.angle = (self.angle + degrees)%360
        previous_center = tuple(self.rect.center)
        # Rotate the image
        self.image = pygame.transform.rotate(self.image, -degrees)  # Use -self.angle for clockwise rotation
        self.rect = self.image.get_rect(center=previous_center)  # Reassign the rect with the updated center
    



# DD. GAME_MANAGER
# game = GameManager()
# interp. main container for our game in pygame
class GameManager():
    def __init__(self):
        self.reset()
        
    def reset(self):
        self.score = 0
<<embed_game_objects>>
        
############### CODE ###################



def draw():
    display.fill("#1e1e1e")
    


def update():
    [pygame.quit() for event in pygame.event.get() if event.type == pygame.QUIT]

while True:
    draw()
    update()