def create_player(player_data):   
    
    if gamestate.hosting:
        player = aiplayer.Bot(
            (0, 0),
            player_data.player_position
        )
    
    else:
        player = NetworkPlayer(
            (0, 0),
            player_data.player_position
        )
    
    player.init_state()
    
    if gamestate.hosting:
        if player_data.player_type == PlayerTypes.BOT:
            player.set_difficulty(player_data.difficulty)
    
    player.set_player_stats(player_data.size)
    player.load_moveset(player_data.moveset)
    player.model.velocity = (0,0)
    player.health_color = player_data.color
    
    if player_data.player_position == PlayerPositions.PLAYER1:
        player.direction = PlayerStates.FACING_RIGHT
        player.model.move_model(gamestate.stage.player_positions[0])
    else:
        player.direction = PlayerStates.FACING_LEFT
        player.model.move_model(gamestate.stage.player_positions[1])
    
    player.action = None
    player.actions[PlayerStates.STANDING].set_player_state(player)
    
    return player