refactor: reference tile size using config

This commit is contained in:
Giovani Rodriguez
2021-06-08 14:07:03 -04:00
parent 4f4ac44b02
commit a9f5320431
2 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
from typing import Tuple
import pygame
from util.ConfigurationManager import ConfigurationManager
class Entity:
def __init__(self, points: Tuple, color: str, border_color: str = None):
self.points = points
@@ -10,7 +12,9 @@ class Entity:
def update(self) -> None:
pass
def draw(self, surface: pygame.Surface, tile_size) -> None:
def draw(self, surface: pygame.Surface) -> None:
tile_size = ConfigurationManager.configuration["engine"]["tile-size"]
for square in self.points:
pygame.draw.polygon(surface, pygame.Color(self.color), square, 0)
if self.border_color: