Working on rotation. /JL

This commit is contained in:
Jan Lerking
2025-04-23 13:45:29 +02:00
parent 68595b1455
commit dd99fcb633
6 changed files with 70 additions and 39 deletions

View File

@@ -1,18 +1,18 @@
import pygame
from globals import TILE_SIZE, grid
from enums import BrickColor
class DropZone():
def __init__(self, tile_size, width, height):
self.dropzone = pygame.Surface((width * tile_size, height * tile_size))
def __init__(self, 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
grid = [self.grid_row] * self.height
def draw(self, screen):
screen.blit(self.dropzone, (self.tile_size * 4, self.tile_size * 1))
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] * self.tile_size, location[1] * self.tile_size))
self.dropzone.blit(brick, (location[0] * TILE_SIZE, location[1] * TILE_SIZE))