"""
shotA.py - Machine Gun like player shot
"""

import common
import shot
import explosionA

class ShotA(shot.Shot):

    # rect = 2d pos -> width and height will be appended!
    def __init__(self,rect,level):
        rect  += [16,4]
        shot.Shot.__init__(self,0,rect)
        self.images = common.images['ShotA']
        self.speed  = 5
        self.level  = level
        self.damage = 2+2*level

        common.shots_player.append(self)

    # from object.py
    def move(self):
        self.rect[1] -= self.speed
        #if self.rect[1]+self.rect[3] < -25:
        if self.rect[1] < - 25:
            common.shots_player.remove(self)

    # from object.py
    def show(self):
        r = common.screen.blit(self.images[0],self.rect)
        if hasattr(self,'last_rect'):
            return [self.last_rect, self.rect]
        else:
            return [self.rect]

    def explode(self):
        explosionA.ExplosionA(self.rect[:2])
        explosionA.ExplosionA([self.rect[0]+12,self.rect[1]])
