draw method sets mapOffset field properly

This commit is contained in:
Marcin Kostrzewski 2020-05-14 12:05:52 +02:00
parent 93f4e9f53d
commit 824a7e33ea

View File

@ -58,6 +58,11 @@ class Screen:
sprite.rect.x += self.mapCoord + self.mapSize sprite.rect.x += self.mapCoord + self.mapSize
elif location.value == Locations.MAP.value: elif location.value == Locations.MAP.value:
sprite.rect.x += self.mapCoord sprite.rect.x += self.mapCoord
# Update Entities mapOffset field
from src.entities.Entity import Entity
if isinstance(sprite, Entity):
sprite.mapOffset = self.mapCoord
self.gameObject.spritesList.add(sprite) self.gameObject.spritesList.add(sprite)
def getUiWidth(self, location: Locations): def getUiWidth(self, location: Locations):