From d88670f456342bf8ad89d75e4879c879581854b3 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Sun, 5 Apr 2020 14:52:19 +0200 Subject: [PATCH] Fixed retarded Entity implementation --- src/entities/Entity.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/entities/Entity.py b/src/entities/Entity.py index 98dff66..857f664 100644 --- a/src/entities/Entity.py +++ b/src/entities/Entity.py @@ -5,10 +5,9 @@ import pygame class Entity(pygame.sprite.Sprite): nextId = 1 - def __init__(self, texture, pos): + def __init__(self, texture, size, pos): super().__init__() - self.image = texture - self.rect = self.image.get_rect() + self.image, self.rect = self.getTexture(texture, size) self.rect.x = pos[0] self.rect.y = pos[1] self.id = self.getId() @@ -20,8 +19,7 @@ class Entity(pygame.sprite.Sprite): return id # A method that returns image and rect from a file - @staticmethod - def getTexture(textureName, tileSize): + def getTexture(self, textureName, tileSize): texturesFolder = "" textureFile = "" try: