def create_pipe(settings, screen, pipes):
    while settings.current_pipe < settings.number_of_pipes[
            settings.current_level]:
        pipe = Pipe(
            settings.pipe_positions[settings.current_level][
                settings.current_pipe], screen,
            settings.pipe_sizes[settings.current_level][settings.current_pipe])
        settings.current_pipe += 1

        pipe.x = pipe.pos[0]
        pipe.y = pipe.pos[1]
        pipes.add(pipe)
Exemplo n.º 2
0
def create_pipes():
    team_data_text3 = '\
                {\
                    "1" : {"x" : 642, "y" : 100, "flag": 1 },\
                    "2" : {"x" : 935, "y" : 100, "flag" : 2 },\
                    "3" : {"x" : 3035, "y" : 100, "flag" : 1},\
                    "4" : {"x" : 3389, "y" : 100, "flag" : 3}\
                }\
                '

    team_data = json.loads(team_data_text3)

    team = []
    for num in team_data:
        player = Pipe()
        player.x = team_data[num]['x'] + 34
        player.y = team_data[num]['y']
        player.flag = team_data[num]['flag']
        player.realx = player.x
        player.realy = player.y
        team.append(player)
    return team