Files
PyGame-Tetris/dropzone.py
2025-04-22 20:23:05 +02:00

19 lines
681 B
Python

import pygame
from enums import BrickColor
class DropZone():
def __init__(self, tile_size, width, height):
self.dropzone = pygame.Surface((width * tile_size, height * tile_size))
self.width = width
self.height = height
self.tile_size = tile_size
self.grid_row = [" "] * self.width
self.grid = [self.grid_row] * self.height
def draw(self, screen):
screen.blit(self.dropzone, (self.tile_size * 4, self.tile_size * 1))
def draw_brick(self, brick, location):
self.dropzone.fill(BrickColor.Black.value)
self.dropzone.blit(brick, (location[0] * self.tile_size, location[1] * self.tile_size))