parameters: (self)
docstring: Main loop.
  
          Updates the world and then the screen.
docstring_summary: Main loop.
docstring_tokens: Main loop .
function: def run(self):
          """
          Main loop.
  
          Updates the world and then the screen.
          """
  
          running = True
          clock = pygame.time.Clock()
          while running:
              for event in pygame.event.get():
                  if event.type == QUIT or (event.type == KEYDOWN and event.key == Keys.K_ESCAPE):
                      running = False
                  elif event.type == KEYDOWN:
                      self.Keyboard(event.key)
                  elif event.type == KEYUP:
                      self.KeyboardUp(event.key)
  
              self.screen.fill((0, 0, 0))
  
              self.textLine = 15
  
              # Step the world
              self.world.Step(TIMESTEP, VEL_ITERS, POS_ITERS)
              self.world.ClearForces()
  
              draw_world(self.screen, self.world)
  
              # Draw the name of the test running
              self.Print(self.name, (127, 127, 255))
  
              if self.description:
                  # Draw the name of the test running
                  for s in self.description.split('\n'):
                      self.Print(s, (127, 255, 127))
  
              pygame.display.flip()
              clock.tick(TARGET_FPS)
              self.fps = clock.get_fps()
  
          self.world.contactListener = None
          self.world.destructionListener = None
          self.world.renderer = None
function_tokens: def run ( self ) : running = True clock = pygame . time . Clock ( ) while running : for event in pygame . event . get ( ) : if event . type == QUIT or ( event . type == KEYDOWN and event . key == Keys . K_ESCAPE ) : running = False elif event . type == KEYDOWN : self . Keyboard ( event . key ) elif event . type == KEYUP : self . KeyboardUp ( event . key ) self . screen . fill ( ( 0 , 0 , 0 ) ) self . textLine = 15 # Step the world self . world . Step ( TIMESTEP , VEL_ITERS , POS_ITERS ) self . world . ClearForces ( ) draw_world ( self . screen , self . world ) # Draw the name of the test running self . Print ( self . name , ( 127 , 127 , 255 ) ) if self . description : # Draw the name of the test running for s in self . description . split ( '\n' ) : self . Print ( s , ( 127 , 255 , 127 ) ) pygame . display . flip ( ) clock . tick ( TARGET_FPS ) self . fps = clock . get_fps ( ) self . world . contactListener = None self . world . destructionListener = None self . world . renderer = None