1
Fork 0

Added position set for after init

This commit is contained in:
Jake Howard 2015-05-09 23:55:43 +01:00
parent 749cdf77a2
commit bfe6ad55ed

View file

@ -20,4 +20,10 @@ class Target(pygame.sprite.Sprite):
self.rect.y += 17 self.rect.y += 17
self.speed *= -1 self.speed *= -1
def set_position(self, x, y, center=False):
if center:
self.rect.x, self.rect.y = (x+(self.width/2)),(y+(self.width/2))
else:
self.rect.x, self.rect.y = x, y