code: def player1():
      game = vzd.DoomGame()
  
      game.load_config(config)
  
      # Setup 2 players deathmatch game that will time out after 1 minute
      game.add_game_args(
          "-host 2 -deathmatch +timelimit 1 +sv_spawnfarthest 1"
      )
  
      # Use additional arguments to set player name, color and window position
      game.add_game_args(
          f"+name Player1 +colorset 0 +win_x {win_x} +win_y {win_y}"
      )
  
      game.init()
  
      actions = [
          [True, False, False],
          [False, True, False],
          [False, False, True],
      ]
  
      for i in range(episodes):
          print(f"Episode #{i + 1}")
  
          while not game.is_episode_finished():
              if game.is_player_dead():
                  game.respawn_player()
  
              game.make_action(choice(actions))
  
          print("Episode finished!")
          print(
              "Player1 frags:",
              game.get_game_variable(vzd.GameVariable.FRAGCOUNT),
          )
  
          # Starts a new episode. All players have to call new_episode() in multiplayer mode.
          game.new_episode()
  
      game.close()
  
imports: import os
  from random import choice
  from threading import Thread
  from time import time
  import vizdoom
label_desc: Use image node_id 1 for calling a global function with example usage: player1() without return types