Added position set for after init
This commit is contained in:
parent
749cdf77a2
commit
bfe6ad55ed
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Reference in a new issue