Fixed relative coord update
This commit is contained in:
parent
2bf0ed035b
commit
823eefac86
@ -55,6 +55,8 @@ class Entity(pygame.sprite.Sprite):
|
|||||||
def setCoords(self, coords, screenRelative=False):
|
def setCoords(self, coords, screenRelative=False):
|
||||||
if screenRelative:
|
if screenRelative:
|
||||||
self.rect.x, self.rect.y = coords
|
self.rect.x, self.rect.y = coords
|
||||||
|
self.x = (self.rect.x - self.mapOffset) / self.rect.w
|
||||||
|
self.y = self.rect.y / self.rect.h
|
||||||
else:
|
else:
|
||||||
self.x, self.y = coords
|
self.x, self.y = coords
|
||||||
self.rect.x = coords[0] * self.rect.w + self.mapOffset
|
self.rect.x = coords[0] * self.rect.w + self.mapOffset
|
||||||
|
Loading…
Reference in New Issue
Block a user