def __init__(self, firing_pos, target_pos): self.init_pos = Vector2D.copy(firing_pos) self.pos = self.init_pos self.direction = Vector2D.normalise(target_pos - self.init_pos) self.velocity = 10 self.radius = 5 self.collision = None self.active = True
def __init__(self, firing_pos, world=None, mode="Rifle"): self.init_pos = Vector2D.copy(firing_pos) self.world = world self.mode = mode self.bullet_speed = self.BULLET_VELOCITY[mode]
def update_firing_pos(self, firing_pos): self.init_pos = Vector2D.copy(firing_pos)