def make_player(cls, raw_player): """create and return a new player from the given info""" first_name = raw_player['FirstName'] last_name = raw_player['LastName'] position = raw_player['Position'] player_id = raw_player['ID'] player = Player.alt_init(first_name, last_name, position) player.set_player_id(player_id) return player
def defineListOfPlayers( ): # returs a list of Objects of Player_class, name = input listOfPlayers = [] for i in range(0, numberOfPlayers): playerName = raw_input("Player name: ") matchToAssingToPlayer = Match(i) player_i = Player(playerName, i, matchToAssingToPlayer) listOfPlayers.append(player_i) return listOfPlayers
def createPlayers(): player_count = 0 #get player count while (player_count <= 0): player_count = int(input('Input the amount of Players: ')) #create players players = [] for i in range(player_count): players.append(Player()) return players
def create_player(self): player = Player() player.name = input("Write your name.") p_type = input("Click C for computer, H for human.") if p_type == "C": player.type = PlayerType.COMPUTER else: player.type = PlayerType.HUMAN p_gender = input("Click M for Male, F for Female.") if p_gender == "M": player.gender = Gender.MALE else: player.gender = Gender.FEMALE return player
def extract_data(cls, db_players, NBA_teams): players = [] #iterate through all of the obtained players for (playerID, Firstname, Lastname, position, points_per_game, assists_per_game, effective_field_goal_percentage, true_shooting_percentage, field_goal_attempts, field_goals_made, free_throw_attempts, free_throws_made, treys_made, off_reb_per_game, def_reb_per_game, points_produced, turnover, usage, minutes, blocks, steals, teamID, teamName, fouls) in db_players: #create a player and populate his stats + info a_player = Player.alt_init(Firstname, Lastname, position) a_player.set_player_id(playerID) a_player.set_points_per_game(points_per_game) a_player.set_assists_per_game(assists_per_game) a_player.set_effective_field_goal_percentage( effective_field_goal_percentage) a_player.set_true_shooting_percentage(true_shooting_percentage) a_player.set_field_goal_attempts(field_goal_attempts) a_player.set_field_goals_made(field_goals_made) a_player.set_free_throw_attempts(free_throw_attempts) a_player.set_free_throws_made(free_throws_made) a_player.set_treys_made(treys_made) a_player.set_off_reb_per_game(off_reb_per_game) a_player.set_points_produced(points_produced) a_player.set_turnover(turnover) a_player.set_player_usage(usage) a_player.set_minutes(minutes) a_player.set_team_id(teamID) a_player.set_team_abbr(teamName) a_player.set_def_reb_per_game(def_reb_per_game) a_player.set_steals(steals) a_player.set_blocks(blocks) a_player.set_fouls(fouls) players.append(a_player) NBA_teams[teamName].add_player(a_player) NBA_teams[teamName].add_players_roster(a_player.get_full_name()) return players
tree, ], ] size_of_tile = 45 lvl_type = 2 clear = [] # used for clearing the list final_level = [] # final list for map # Creating sprite groups all_sprites_list = pygame.sprite.Group() shooting_list = pygame.sprite.Group() enemy_list = pygame.sprite.Group() # Instance variables player = Player() all_sprites_list.add(player) close = True wave = True def game(score, layout): """Main program for game""" # Variables declared global global event global score_1, score_2 global wave_number global hp