diff --git a/pyshoot.py b/pyshoot.py index 25b7570..2b138fe 100755 --- a/pyshoot.py +++ b/pyshoot.py @@ -72,6 +72,14 @@ class BulletFactory(): bullet.damage = 10 return bullet + def create_type1(self, pos): + """ create a bullet of type 1 + temporary laser type """ + + bullet = Bullet(['laser1.bmp', 'laser2.bmp', 'laser3.bmp'], 0, pos) + bullet.speed = (10,0) + bullet.damage = 10 + return bullet class Bullet(Object): def __init__(self, frames, type, pos): @@ -96,10 +104,11 @@ class Player(Object): def __init__(self, frames, pos, speed): Object.__init__(self, frames, pos, speed) self.shooting = False + self.bullet_type = 0 def shoot(self): """ create a bullet and add it to the global bullet list""" - bullet = globals.bulletfactory.create(0, self.rect.midright) + bullet = globals.bulletfactory.create(self.bullet_type, self.rect.midright) globals.bullets_list.add(bullet) def start_move(self, vector):