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
def __init__(self, position): self.position = position self.old_position = copy.deepcopy(self.position) self.velocity = bloom_vector.bloomVector(0.0, 0.0) self.acceleration = bloom_vector.bloomVector(0.0, 0.0) self.rotation = 0.0 self.rotation_velocity = 0.0 self.rotation_acceleration = 0.0 self.scale = 1.0 self.color = [1.0, 1.0, 1.0, 1.0] self.size = 0.0 self.life_time = 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