Exemple #1
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x - 10,
                                                   self.y - 10))
     self.shot_positions.append(enemy.ShotPosition(self.x - 10,
                                                   self.y + 10))
     self.shot_positions.append(enemy.ShotPosition(self.x + 10,
                                                   self.y - 10))
     self.shot_positions.append(enemy.ShotPosition(self.x + 10,
                                                   self.y + 10))
     self.bullet_speed = 1.5
     # self.move_functions.append(self.move_pattern1(0.4, 0.4, 1, 2, -math.pi / 2, 0.005))
     for start_angle in range(0, 360, 30):
         self.set_shot_function(self.shot_positions[0].pattern19(
             start_angle, 2.1, 21, 180, math.inf, 1, 0, 60,
             lambda count: 16,
             lambda count: math.sin(self.count / 140) * 3))
     start_angle = random.randint(0, 360)
     self.set_shot_function(self.shot_positions[1].pattern19(
         start_angle, 1.5, 20, 0, angle_function=lambda count: 7))
     self.set_shot_function(self.shot_positions[2].pattern19(
         start_angle + 90, 1.5, 20, 0, angle_function=lambda count: -7))
     self.set_shot_function(self.shot_positions[3].pattern19(
         start_angle + 180, 1.5, 20, 0, angle_function=lambda count: 7))
     self.set_shot_function(self.shot_positions[4].pattern19(
         start_angle + 270, 1.5, 20, 0, angle_function=lambda count: -7))
Exemple #2
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_positions.append(enemy.ShotPosition(0, 0))
     self.shot_positions.append(enemy.ShotPosition(pyxel.width, 0))
     self.position_sigma = 10  # 標準偏差
     self.move_functions.append(
         self.move_pattern1(0.5, 0.5, 3, 2.5, -math.pi / 2, 0.01))
     self.set_shot_function(self.shot_positions[0].pattern3(3, 5, 1.1, 40))
Exemple #3
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x-13, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x+13, self.y))
     self.shot_count = 0
     self.start_angle = 0
     self.delta_angle2 = 60
     self.move_functions.append(self.move_pattern1(2, 1.4, 2, 5, -math.pi / 2, 0.04))
Exemple #4
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x - 20, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x + 20, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.move_functions.append(
         self.move_pattern1(0.5, 0.9, 1, 2, math.pi / 2, 0.04))
     angle_function = lambda count: 100 * math.sin(count / 30)
     self.set_shot_function(self.shot_positions[0].pattern1(
         0, 4, 2, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[1].pattern1(
         180, 4, 2, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[2].pattern17(
         0, 360, 0.8, 5))
Exemple #5
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x - 10, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x + 10, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y + 10))
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y - 10))
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     angle_function = lambda count: 2.4 * count
     self.set_shot_function(self.shot_positions[0].pattern1(0, 0.6, 9, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[1].pattern1(0, 0.6, 9, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[2].pattern1(0, 0.6, 9, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[3].pattern1(0, 0.6, 9, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[4].pattern2(2, 40))
     self.set_shot_function(self.shot_positions[4].pattern2(2, 40, 500))
Exemple #6
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_positions.append(enemy.ShotPosition(self.x - 20,
                                                   self.y - 20))
     self.shot_positions.append(enemy.ShotPosition(self.x - 20,
                                                   self.y + 20))
     self.shot_positions.append(enemy.ShotPosition(self.x + 20,
                                                   self.y - 20))
     self.shot_positions.append(enemy.ShotPosition(self.x + 20,
                                                   self.y + 20))
     self.pattern1_init = False
     self.pattern2_init = False
     self.pattern3_init = False
     self.pattern4_init = False
     self.shot_count = 0
Exemple #7
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     angle_function = lambda count: 30 * math.sin(self.count)
     self.set_shot_function(self.shot_positions[0].pattern1(90, 1.8, 2, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[0].pattern1(-90, 1.8, 10, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[0].pattern1(0, 1.8, 10, 0, math.inf, angle_function))
     self.set_shot_function(self.shot_positions[0].pattern1(180, 1.8, 10, 0, math.inf, angle_function))
Exemple #8
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.move_functions.append(self.move_pattern1(1.6, 0.5, 1, 2, math.pi / 2, 0.03))
     angle_function1 = lambda count: 26 * math.sin(count / 20)
     angle_function2 = lambda count: -26 * math.sin(count / 20)
     self.set_shot_function(self.shot_positions[0].pattern1(130, 4, 2, 0, math.inf, angle_function1))
     self.set_shot_function(self.shot_positions[0].pattern1(50, 4, 2, 0, math.inf, angle_function2))
     self.set_shot_function(self.shot_positions[0].pattern1(90, 0.8, 10, 0, math.inf, angle_function1))
Exemple #9
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_count = 0
     self.start_angle = 0
     self.delta_angle2 = 60
     self.move_functions.append(
         self.move_pattern1(0.4, 1.1, 2, 5, -math.pi / 2, 0.02))
     self.set_shot_function(self.shot_positions[0].pattern11(
         10, 36, random.randint(0, 360), 7, 0.8, 0.18, 45))
Exemple #10
0
    def __init__(self, x, y, width, height, hp, color):
        super().__init__(x, y, width, height, hp, color)
        self.shot_positions.append(enemy.ShotPosition(self.x, self.y))

        self.bullet_speed = 1.5
        self.shot_count = 0
        self.pattern1_init = False
        self.pattern2_init = False
        self.pattern3_init = False
        self.first_angle = random.randint(0, 360)
        self.move_functions.append(
            self.move_pattern1(0.5, 0.3, 1, 2, -math.pi / 2, 0.05, 0,
                               math.inf))
Exemple #11
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.bullet_speed = 1.5
     self.shot_count = 0
     self.move_functions.append(
         self.move_pattern1(0.4, 0.7, 1, 6, math.pi / 2, 0.008))
     self.bit_formation = {
         "1": {
             "x": self.x,
             "y": self.y + 50,
             "bit_object": None
         },
         "2": {
             "x": self.x - 50,
             "y": self.y + 50,
             "bit_object": None
         },
         "3": {
             "x": self.x + 50,
             "y": self.y + 50,
             "bit_object": None
         }
     }
Exemple #12
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.set_move_function(
         self.move_pattern1(2, 0.5, 1, 2, math.pi / 2, 0.03))
     self.set_shot_function(self.shot_positions[0].pattern4(6, 60, 2.1, 40))
Exemple #13
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.set_shot_function(self.shot_positions[0].pattern5(
         7, 2, 5, 1, 0.2, 100, 50))
Exemple #14
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.bullet_speed = 1.5
     self.move_functions.append(
         self.move_pattern1(0.4, 0.4, 1, 2, -math.pi / 2, 0.005))
Exemple #15
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_functions.append(self.shot_positions[0].pattern3(
         1, 11, 1.5, 60))
Exemple #16
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_count = 0
     self.main_shot_target_position = 90
Exemple #17
0
 def __init__(self, x, y, width, height, hp, color):
     super().__init__(x, y, width, height, hp, color)
     self.shot_positions.append(enemy.ShotPosition(self.x, self.y))
     self.shot_count = 0
     self.start_angle = 0
     self.delta_angle2 = 0