Esempio n. 1
0
    def fire(self):
        newBullets = []
        if self.life_time - self.last_fire >= self.fire_speed:
            self.last_fire = self.life_time
            if self.target == None:
                newBullet = bloom_bullet.bloomBullet(copy.deepcopy(self.position), bloom_vector.bloomVector(0.0, 1.0), self.team, 1)
            else:
                newBullet = bloom_bullet.bloomBullet(copy.deepcopy(self.position), bloom_vector.bloomVector(self.target.position[0] - self.position[0], self.target.position[1] - self.position[1]), self.team, 1)
            newBullet.color = [0.0, 0.0, 1.0, 1.0]
            newBullets.append(newBullet)

        return newBullets
Esempio n. 2
0
    def fire(self):
        newBullets = []
        if self.life_time - self.last_fire > self.fire_speed:
            self.last_fire = self.life_time
            newBullet = bloom_bullet.bloomBullet(copy.deepcopy(self.position), bloom_vector.bloomVector(0.0, 1.0), self.team, 0)
            newBullet.color = self.color
            newBullets += [newBullet]

        return newBullets