Exemplo n.º 1
0
def pattern_3(fire, x, y, state):
    dir = math.atan2(hero.find_y() - y, hero.find_x() - x)
    if int(fire) % 8 == 0:
        bullet1 = Boss_bullet(x, y, dir - math.pi / 10, state)
        game_world.add_object(bullet1, 3)

    elif int(fire) % 8 == 1:
        bullet2 = Boss_bullet(x, y, dir + math.pi / 10, state)
        game_world.add_object(bullet2, 3)
Exemplo n.º 2
0
def pattern_head_2(fire, x, y, state, degree):
    if int(fire) % 8 == 0:
        bullet1 = Boss_bullet(x, y, math.radians(degree), state)
        game_world.add_object(bullet1, 3)
    elif int(fire) % 8 == 1:
        bullet2 = Boss_bullet(x, y, math.radians(degree) - math.pi / 4, state)
        game_world.add_object(bullet2, 3)
    elif int(fire) % 8 == 2:
        bullet3 = Boss_bullet(x, y,
                              math.radians(degree) - math.pi / 4 * 2, state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 3:
        bullet4 = Boss_bullet(x, y,
                              math.radians(degree) + math.pi / 4 * 3, state)
        game_world.add_object(bullet4, 3)
    elif int(fire) % 8 == 4:
        bullet4 = Boss_bullet(x, y, math.radians(degree) + math.pi / 4, state)
        game_world.add_object(bullet4, 3)
    elif int(fire) % 8 == 5:
        bullet4 = Boss_bullet(x, y,
                              math.radians(degree) + math.pi / 4 * 2, state)
        game_world.add_object(bullet4, 3)
    elif int(fire) % 8 == 6:
        bullet4 = Boss_bullet(x, y,
                              math.radians(degree) + math.pi / 4 * 3, state)
        game_world.add_object(bullet4, 3)
    elif int(fire) % 8 == 7:
        bullet4 = Boss_bullet(x, y, math.radians(degree) + math.pi, state)
        game_world.add_object(bullet4, 3)
Exemplo n.º 3
0
def pattern_4(fire, x, y, state, degree):
    #dir = math.atan2(hero.find_y() - y, hero.find_x() - x)
    if int(fire) % 4 == 0:
        bullet1 = Boss_bullet(x, y, math.radians(degree), state)
        game_world.add_object(bullet1, 3)
    elif int(fire) % 4 == 1:
        bullet2 = Boss_bullet(x, y, math.radians(degree) - math.pi / 2, state)
        game_world.add_object(bullet2, 3)
    elif int(fire) % 4 == 2:
        bullet3 = Boss_bullet(x, y, math.radians(degree) - math.pi, state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 4 == 3:
        bullet4 = Boss_bullet(x, y, math.radians(degree) + math.pi / 2, state)
        game_world.add_object(bullet4, 3)
Exemplo n.º 4
0
def pattern_head_3(fire, x, y, state, degree):
    if int(fire) % 8 == 0:
        bullet1 = Boss_bullet(x, y, math.radians(degree + 45), state)
        game_world.add_object(bullet1, 3)
    elif int(fire) % 8 == 1:
        bullet2 = Boss_bullet(x, y, math.radians(degree + 90), state)
        game_world.add_object(bullet2, 3)
    elif int(fire) % 8 == 2:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 135), state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 3:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 180), state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 4:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 225), state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 5:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 270), state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 6:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 315), state)
        game_world.add_object(bullet3, 3)
    elif int(fire) % 8 == 7:
        bullet3 = Boss_bullet(x, y, math.radians(degree + 360), state)
        game_world.add_object(bullet3, 3)
Exemplo n.º 5
0
def enter():
    global background, score_title, player_life, plane, my_bullet, final_boss, boss_bullet, my_bullet, boss_hp_bar, death_plane_final_boss
    background = Background()
    score_title = Score_title()
    player_life = Player_life()
    plane = Plane()
    final_boss = Boss_enemy()
    boss_hp_bar = Boss_hp_bar()
    my_bullet = bullet_list
    boss_bullet = [Boss_bullet(i) for i in range(20)]
    game_world.add_object(background, 0)
    game_world.add_object(score_title, 1)
    game_world.add_object(player_life, 1)
    game_world.add_object(boss_hp_bar, 1)
    game_world.add_object(plane, 1)
    game_world.add_object(final_boss, 1)
    game_world.add_objects(boss_bullet, 1)
Exemplo n.º 6
0
def pattern_head_1(fire, x, y, state):
    dir = math.atan2(hero.find_y() - y, hero.find_x() - x)
    if int(fire) % 100 == 0:
        bullet = Boss_bullet(x, y, dir, state + 3)
        game_world.add_object(bullet, 3)
Exemplo n.º 7
0
def pattern_tentacle(fire, x, y, state):
    dir = math.atan2(hero.find_y() - y, hero.find_x() - x)
    if int(fire) % 13 == 0:
        bullet = Boss_bullet(x, y, dir + math.radians(random.randint(-5, 5)),
                             state)
        game_world.add_object(bullet, 3)
Exemplo n.º 8
0
def pattern_5(fire, x, y, state):
    #dir = math.atan2(hero.find_y() - y, hero.find_x() - x)
    if int(fire) % 1 == 0:
        bullet = Boss_bullet(x, y, math.radians(random.randint(0, 360)), state)
        game_world.add_object(bullet, 3)
Exemplo n.º 9
0
def boss_shoot(ai_settings, screen, boss, boss_bullets):
    """lets the boss shoot"""
    new_boss_bullet = Boss_bullet(ai_settings, screen, boss)
    boss_bullets.add(new_boss_bullet)