示例#1
0
                area = battlefield.begin_journey2(area, players_army)
            if area == battlefield.area2a:
                area = battlefield.begin_journey2(area, players_army)
            if area == battlefield.area3:
                break
        area = battlefield.begin_journey3(area, players_army)

        rounds = the_game.rounds
        next_move = [False, battlefield.area3]
        while not the_game.end and players_army.race == "Robots":
            next_move = the_game.battle_start(rounds, players_army,
                                              enemies_army)
            if next_move == [False, battlefield.area2b]:
                area = battlefield.area2b
            if next_move == True:
                the_game.end = next_move
                break

            while area == battlefield.area1 or area == battlefield.area1a or area == battlefield.area2 or area == battlefield.area2a or next_move[
                    1] == battlefield.area2b or area == battlefield.area_end:
                if area == battlefield.area1:
                    area = battlefield.begin_journey(area, players_army)

                if area == battlefield.area1a:
                    area = battlefield.begin_journey(area, players_army)
                if area == battlefield.area2:
                    area = battlefield.begin_journey2(area, players_army)
                if area == battlefield.area2a:
                    area = battlefield.begin_journey2(area, players_army)
                if area == battlefield.area2b:
                    area = battlefield.begin_journey2(area, players_army)
示例#2
0
文件: game.py 项目: dstonem/max_run
            index = 0

    if enemies == [] and won == False:
        message_display("Press '8' to Advance", 28, (width / 2, height / 2))

    ### ADDITIONAL SCORING THINGS
    for enemy in enemies:
        if enemy.pos["y"] <= 10 and enemy.pos["y"] >= -10 and game.level > 0:
            game.add_score(5)
        if enemy.pos["y"] <= height + 10 and enemy.pos[
                "y"] >= height - 10 and game.level > 0:
            game.add_score(5)

    #### LOSING
    if max.health < 5:
        game.end(max)
    if game.level == -1:
        message_display("GAME OVER", 115, (width / 2, 400))
        message_display("Press 'p' To Play Again", 28, (width / 2, 500))
        message_display(f"Score: {game.score}", 115, (width / 2, 200))
        for enemy in enemies:
            enemy.dance()
        count = 0
        for i in range(0, 100):
            max_img = pygame.transform.scale(max_img, (count + 100, 125))
            count -= 1

    if game.level > 0 and enemies == [] and new_friends:
        index = 0

        position_counterx = 0