19 lines
501 B
Python
19 lines
501 B
Python
import pygame
|
|
from game_object import GameObject
|
|
|
|
|
|
class Window:
|
|
def __init__(self, title: str, size: tuple, background_color: tuple=(0, 0, 0)) -> None:
|
|
pygame.init()
|
|
pygame.display.set_caption(title)
|
|
self.__surface = pygame.display.set_mode(size=size)
|
|
self.__color = background_color
|
|
|
|
|
|
def reset(self) -> None:
|
|
self.__surface.fill(self.__color)
|
|
|
|
|
|
def draw_object(self, game_object: GameObject) -> None:
|
|
game_object.draw(self.__surface)
|
|
|