code: def increment_frame(self):
          
          if self.current_frame < len(self.images):
              self.current_frame += 1
  
              if self.current_frame >= len(self.images):
                  # Wrap back to the beginning of the animation if should_repeat is true.
                  if self.should_repeat:
                      self.current_frame = 0
                  else:
                      # Clamp the current frame to the number of images we have in our list
                      self.current_frame = len(self.images) - 1
  
              # Set the image that is currently displaying.
              if self.current_frame < len(self.images):
                  self.image = self.images[self.current_frame]
                  self.image.coords = self.coords
docs: Increment a frame of the animation.