title: How to blit sprites to screen on timed increments in PyGame
body: <p>I'm making a game in Pygame in which the some characters appear on one side of the screen and move to the other, where they teleport to the place they started from and do it again. I want the sprites to appear one at a time, with a random time increment between their spawning. I have created a class for the sprites, and I have put them in a group called "monsters". My blitting them looks like this:</p>
  
  <pre><code>for monster in monsters:
              monster.render(screen)
              time.sleep(0.5)
  </code></pre>
  
  <p>What this does is make the screen go black until all the monsters spawn. I want them to spawn one at a time and for the player to be able to see that. Here's the whole class that code above is in:</p>
  
  <pre><code>import pygame, sys, random, time
  from monster import *
  
  pygame.init()
  
  class Main:
      clock = pygame.time.Clock()
  
      screenSize = (500,500)
      background = pygame.image.load("C:/Users/Nathan/PycharmProjects/Monsters II A Dark Descent/images/background.jpg")
  
      screen = pygame.display.set_mode(screenSize)
      pygame.display.set_caption("MONSTERS!")
  
      monsters = pygame.sprite.Group()
  
      counter = 0
  
      x = 450
      while counter &lt; 5:
              y = random.randint(50,450)
              monster = Monster(x,y)
              monsters.add(monster)
              counter = counter + 1
  
      while True:
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  sys.exit()
  
          screen.blit(background,(0,0))
  
          for monster in monsters:
              monster.render(screen)
              time.sleep(0.5)
  
  
          x=x-1
  
          clock.tick(60)
  
          pygame.display.flip()
  
  
  Main()
  </code></pre>
  
  <p>I am also having a second issue. I want the sprites to move a random speed (their current position(x) plus a random number) once they spawn. I also want them to teleport where they started and do it again once they reach the end of the screen. Here is the sprite movement class:</p>
  
  <pre><code>def move(self):
          if(self.x &gt; 500):
              self.x = 450
          self.x -= random.randint(1,5)
  </code></pre>
  
  <p>Currently them move at varying speeds and just go off the edge of the screen. Here is the whole sprite class:</p>
  
  <pre><code>import random, pygame
  
  class Monster(pygame.sprite.Sprite):
  
      def __init__(self, x, y):
          pygame.sprite.Sprite.__init__(self)
          self.x = x
          self.y = y
          self.image = pygame.image.load("C:\Users\Nathan\PycharmProjects\Monsters II A Dark Descent\images\monster.png")
  
      def move(self):
          if(self.x &gt; 500):
              self.x = 450
          self.x -= random.randint(1,5)
  
      def render(self, screen):
          screen.blit(self.image, (self.x, self.y))
  </code></pre>
  
  <p>Thank you for your time. If you need any more details let me know.</p>