def create_pipe(ai_settings,pipes,number_pipe,uppipes_y): pipe = Pipe(ai_settings) pipe.x=ai_settings.screen_width+ai_settings.pipe_width/2\ +number_pipe*(ai_settings.screen_width /(ai_settings.number_pipes-2)) pipe.rect.x =pipe.x pipe.rect.y=uppipes_y[number_pipe]+ai_settings.pipe_height+ai_settings.disty pipes.add(pipe)
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)
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