From 272b60de5b46edfddcc11a2d9b35faa3d6f77215 Mon Sep 17 00:00:00 2001 From: kleph Date: Sat, 15 Aug 2009 02:33:14 +0200 Subject: [PATCH] move the metho shoot from Object to Player --- pyshoot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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"""