Files
PyGame-Tetris/dropzone.py
2025-04-23 13:45:29 +02:00

19 lines
646 B
Python

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