title: Making an enemy that shoots bullets in pygame
body: <p>I am making a platform game and it has a level where there is a bullet being fired constantly in the same direction at the player. However, I can get 1 bullet to fire but I can't add more bullets to the list to fire repeatedly in constant intervals. Any help would be appreciated!</p>
  
  <pre><code>    class Bullets(pygame.sprite.Sprite):
          def __init__(self,x,y):
              pygame.sprite.Sprite.__init__(self)
  
              self.image = pygame.image.load("Images/bullet.png")
              self.rect = self.image.get_rect()
              self.rect.x = x
              self.rect.y = y
  
          def update(self):
              self.rect.y += 4
  
              if self.rect.y &gt; 520:
                  BulletList.empty()
  
      def main3():
          moveX = 0
          TrapList.empty()
  
          player.rect.x,player.rect.y = 50,0
          BulletList.add(bullet)
          FiringBullet = pygame.USEREVENT + 1
          pygame.time.set_timer(FiringBullet, 3000)
  
          GameExit = False
  
          while GameExit==False:
              for event in pygame.event.get():
                  if event.type == pygame.QUIT:
                      pygame.quit()
                      quit()
  
                  if event.type == pygame.KEYDOWN:
                      if event.key == pygame.K_LEFT:
                          player.move(-player.speed,0)
                      if event.key == pygame.K_RIGHT:
                          player.move(player.speed,0)
                      if event.key == pygame.K_UP:
                          player.move(0,-10)
  
                  if event.type == pygame.KEYUP:
                      if event.key == pygame.K_LEFT:
                          player.move(player.speed,0)
                      if event.key == pygame.K_RIGHT:
                          player.move(-player.speed,0)
                      if event.key == pygame.K_UP:
                          player.move(0,0)
  
                  if event.type == FiringBullet:
                      BulletList.add(bullet)
              print(BulletList)
  
              screen.fill(BLACK)
              level3.update()
  
              if player.rect.x &gt; 350:
                  for eachbullet in BulletList:
                      BulletList.draw(screen)
                      BulletList.update()
  
  
              playergroup.update()
              playergroup.draw(screen)
  
              player.Level3PlatColl(BlockListDirt2)
              pygame.display.update()
              clock.tick(60)
          bullet = Bullets(400,200)
          BulletList = pygame.sprite.Group()
  main3()
  </code></pre>