18 lines
411 B
Python
18 lines
411 B
Python
import pygame
|
|
|
|
|
|
class Window:
|
|
def __init__(self, title, size, background_color=(0, 0, 0)):
|
|
pygame.init()
|
|
pygame.display.set_caption(title)
|
|
self.__surface = pygame.display.set_mode(size=size)
|
|
self.__color = background_color
|
|
|
|
|
|
def reset(self):
|
|
self.__surface.fill(self.__color)
|
|
|
|
|
|
def draw_object(self, game_object):
|
|
game_object.draw(self.__surface)
|
|
|