def __init__(self, player): AbilityInstance.__init__(self, player) self.type = "WaterPrimaryInstance" self.projectile = objects.ProjectileObject(self.player, self.projectile_radius, self.duration) self.projectile.position = self.player.position self.projectile.collided += self.on_collided self.projectile.rotate(player.rotation)
def __init__(self, player): AbilityInstance.__init__(self, player) self.type = "FireRingOfFireInstance" self.time_to_live = self.duration self.ring_of_fire = objects.ProjectileObject(self.player, self.radius, self.duration) self.ring_of_fire.position = self.player.position self.ring_of_fire.bounding_shape = collision.BoundingCircle(self.radius, True) self.ring_of_fire.outer_bounding_circle = collision.BoundingCircle(self.radius + self.ring_thickness, True) self.ring_of_fire.inner_bounding_circle = collision.BoundingCircle(self.radius - self.ring_thickness, True) self.ring_of_fire.move_speed = 0 self.ring_of_fire.is_moving = False
def run(self): AbilityInstance.run(self) #make the projectile's projectileobject self.hook_projectile = objects.ProjectileObject(self.player, self.projectile_radius, self.projectile_duration) self.hook_projectile.position = self.start_position self.hook_projectile.bounding_shape = collision.BoundingCircle(self.projectile_radius) self.hook_projectile.rotation = self.start_rotation self.hook_projectile.move_speed = self.projectile_velocity self.hook_projectile.is_moving = True self.player.world.add_object(self.hook_projectile) self.hook_projectile.collided += self.on_collided # throw event self.hook_projectile_created(self.hook_projectile)