se_uebungen/snake/window.py
2026-04-16 14:53:24 +02:00

14 lines
328 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)