diff --git a/pyshoot.py b/pyshoot.py index 0f695e3..17880a3 100755 --- a/pyshoot.py +++ b/pyshoot.py @@ -65,10 +65,6 @@ class Object(pygame.sprite.Sprite): # self.rect = self.rect.move(self.dx, self.dy) self.rect.move_ip(self.speed) - def shoot(self): - """ create a bullet and add it to the global bullet list""" - bullet = globals.bulletfactory.create(0, self.rect.midright) - globals.bullets_list.add(bullet) class BulletFactory(): @@ -98,6 +94,10 @@ class Player(Object): def __init__(self, frames, pos, speed): Object.__init__(self, frames, pos, speed) + def shoot(self): + """ create a bullet and add it to the global bullet list""" + bullet = globals.bulletfactory.create(0, self.rect.midright) + globals.bullets_list.add(bullet) def init_gfx(): """graphics initialisation"""