예제 #1
0
    def __init__(self, x, y, image_str):
        SpriteBase.__init__(self, x, y, image_str)
        Enemy.List.add(self)

        w, h = self.image.get_size()
        scale = 0.6
        self.image = pygame.transform.scale(self.image,
                                            (int(w * scale), int(h * scale)))
        self.health = 100.0

        # perda em porcentagem
        self.loss = 10

        self.velx = randint(100, 100)
        self.vely = randint(100, 100)
        self.amplitude, self.period = randint(400, 440), randint(2, 5) / 100.0
        # self.amplitude, self.period = randint(20, 140), randint(4, 5) / 100.0

        self.sound_impact = pygame.mixer.Sound(
            sounds.resource['enemy_explosion'])
        self.channel_impact = None

        self.sound_explosion = pygame.mixer.Sound(
            sounds.resource['enemy_explosion'])
        self.channel_explosion = None
예제 #2
0
    def __init__(self, x, y, image_str):
        SpriteBase.__init__(self, x, y, image_str)
        Player.List.add(self)

        # heft(peso): poder de destruição
        self.heft = 5
        self.velx = 0
        self.speed = 600
        self.position = Vec2(x, y)
        self.airplane = pygame.mixer.Sound(sounds.resource['airplane'])
        self.airplane_channel = self.airplane.play(-1)
예제 #3
0
    def __init__(self, x, y, image_str):
        SpriteBase.__init__(self, x, y, image_str)
        Player.List.add(self)

        # heft(peso): poder de destruição
        self.heft = 5
        self.velx = 0
        self.speed = 600
        self.position = Vec2(x, y)
        self.airplane = pygame.mixer.Sound(sounds.resource['airplane'])
        self.airplane_channel = self.airplane.play(-1)
예제 #4
0
    def __init__(self, x, y, image_str):
        SpriteBase.__init__(self, x, y, image_str)
        Enemy.List.add(self)

        w, h = self.image.get_size()
        scale = 0.6
        self.image = pygame.transform.scale(self.image,
                                            (int(w*scale), int(h*scale)))
        self.health = 100.0

        # perda em porcentagem
        self.loss = 10

        self.velx = randint(100, 100)
        self.vely = randint(100, 100)
        self.amplitude, self.period = randint(400,440), randint(2, 5) / 100.0
        # self.amplitude, self.period = randint(20, 140), randint(4, 5) / 100.0
        
        
        self.sound_impact = pygame.mixer.Sound(sounds.resource['enemy_explosion'])
        self.channel_impact = None
        
        self.sound_explosion = pygame.mixer.Sound(sounds.resource['enemy_explosion'])
        self.channel_explosion = None