From bfe6ad55ed9f7677d2028d1c6fb791aa6b2ef3cb Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 9 May 2015 23:55:43 +0100 Subject: [PATCH] Added position set for after init --- target.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target.py b/target.py index f69ab8d..047a5ec 100644 --- a/target.py +++ b/target.py @@ -20,4 +20,10 @@ class Target(pygame.sprite.Sprite): self.rect.y += 17 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 +