game_display.blit(score_text, (0, 0))

    for enemybullet in shooterfleet.enemybullets_fired:
        if enemybullet.has_collided_with(hero):
            hero.is_alive = False

    fleet.remove_dead_ships()

    bossfleet.remove_dead_ships()
    limbfleet1.remove_dead_ships()
    limbfleet2.remove_dead_ships()
    limbfleet3.remove_dead_ships()
    limbfleet4.remove_dead_ships()

    hero.move(GAME_LEFT_WALL, GAME_RIGHT_WALL)
    fleet.move_over()
    hero.move_all_bullets()
    shooterfleet.move_all_enemybullets()

    hero.show(game_display)
    fleet.show(game_display)
    hero.show_all_bullets(game_display)
    shooterfleet.show_all_enemybullets(game_display)
    if score >= 400:
        bossfleet.show(game_display)
        limbfleet1.show(game_display)
        limbfleet2.show(game_display)
        limbfleet3.show(game_display)
        limbfleet4.show(game_display)

    pygame.display.update()
Ejemplo n.º 2
0
    fleet.handle_wall_collision(GAME_LEFT_WALL, GAME_RIGHT_WALL)
    hero.handle_wall_collision_for_bullets(GAME_TOP_WALL)

    for bullet in hero.bullets_fired:
        for ship in fleet.ships:
            if bullet.has_collided_with(ship):
                bullet.is_alive = False
                ship.is_alive = False
                explosion_sound.play()

    fleet.remove_dead_ships()

    hero.move_all_bullets()
    hero.move(GAME_LEFT_WALL, GAME_RIGHT_WALL)
    fleet.move_over(GAME_LEFT_WALL, GAME_RIGHT_WALL)

    show_background()
    hero.show(game_display)
    fleet.show(game_display)
    hero.show_all_bullets(game_display)

    # score_text = score_font.render(str(snake.score), False, WHITE)
    # game_display.blit(score_text, (0,0))

    pygame.display.update()

    clock.tick(30)

pygame.display.quit()
pygame.quit