class_docstr: Basic implementation of a synchronous client.
class_docstr_tok: ["Basic","implementation","of","a","synchronous","client","."]
docstr: Main program loop.
docstr_tok: ["Main","program","loop","."]
code: def game_loop(self):
      """
      Main program loop.
      """
  
      try:
          pygame.init()
  
          self.client = carla.Client("127.0.0.1", 2000)
          self.client.set_timeout(2.0)
          self.world = self.client.get_world()
  
          self.setup_car()
          self.setup_camera()
  
          self.display = pygame.display.set_mode(
              (VIEW_WIDTH, VIEW_HEIGHT),
              pygame.HWSURFACE | pygame.DOUBLEBUF,
          )
          pygame_clock = pygame.time.Clock()
  
          self.set_synchronous_mode(True)
          vehicles = self.world.get_actors().filter("vehicle.*")
  
          while True:
              self.world.tick()
  
              self.capture = True
              pygame_clock.tick_busy_loop(20)
  
              self.render(self.display)
              bounding_boxes = (
                  ClientSideBoundingBoxes.get_bounding_boxes(
                      vehicles, self.camera
                  )
              )
              ClientSideBoundingBoxes.draw_bounding_boxes(
                  self.display, bounding_boxes
              )
  
              pygame.display.flip()
  
              pygame.event.pump()
              if self.control(self.car):
                  return
  
      finally:
          self.set_synchronous_mode(False)
          self.camera.destroy()
          self.car.destroy()
          pygame.quit()
  
imports: import glob
  import os
  import sys
  import carla
  import weakref
  import random
label_desc: Use image node_id 9 for calling the BasicSynchronousClient obj's underlying member method code with example usage: obj.game_loop() without return types