title: Trouble creating multiple instances in python/pygame
body: <p>I've been creating a smup game. The problem is that I have multiple instances of enemies within the game which are supposed to fall from the top of the screen.All of my instances except for one hang at the top of the screen. For some bizarre reason it appears that only one instance of my enemy objects seem to move. I've spent hours trying to fix it to absolutely no avail. I've also browsed a plethora of tutorials on how to create classes, and I can't find anything really wrong with my code. Please help.</p>
  
  <pre><code>import pygame,random,os
  from pygame.locals import *
  'initialize pygame'
  pygame.init()
  'set variables'
  red = (255,0,0)
  green = (0,255,0)
  blue = (0,0,255)
  black = (0,0,0)
  white = (255,255,255)
  width = 1280
  height = 720
  'create window'
  screen =  pygame.display.set_mode((1280,720))
  clock = pygame.time.Clock()
  'sprite groups'
  all_sprites = pygame.sprite.Group()
  enemies = pygame.sprite.Group()
  'classes'
  class Player(pygame.sprite.Sprite):
      def __init__(self):
          self.x, self.y = pygame.mouse.get_pos()
          pygame.sprite.Sprite.__init__(self)
          #self.image = pygame.Surface((32,32))++--3
          #$self.image.fill((green))
          self.image = pygame.image.load("vehicle.png")
          self.image.set_colorkey(white)
          self.rect = self.image.get_rect()
          self.rect.center = (width/2,700)
          self.speed = 0
      def move(self):
          self.keypress = pygame.key.get_pressed()
          if self.keypress[pygame.K_a]:
              self.speed = 3
              self.rect.x -= self.speed
          if self.keypress[pygame.K_d]:
              self.speed = 3
              self.rect.x += self.speed
          #self.rect.x += 1
          if self.rect.left &gt; width:
              self.rect.right = 0
          if self.rect.right &lt; 0:
              self.rect.left = 1280
  class Enemy(pygame.sprite.Sprite):
      def __init__(self):
          pygame.sprite.Sprite.__init__(self)
          self.image = pygame.image.load("missile.png")
          self.rect = self.image.get_rect()
          self.rect.x = random.randrange(50,width)
          self.rect.y = random.randrange(-100,-40)
          self.speedy = random.randrange(1,5)
      def enmove(self):
          self.rect.y = self.rect.y + self.speedy
          if self.rect.top &gt; height:
              self.rect.x = random.randrange(50,width)
              self.rect.y = random.randrange(-100,-40) 
              self.speedy = random.randrange(1,5)            
  class bullet(pygame.sprite.Sprite):
      def __init__(self):
          pygame.sprite.Sprite.__init__(self)
          self.image = pygame.Surface((32,32))
          self.rect = self.image.get_rect()
      def bmove(self):
          pass
  
  
  
  
  
  player = Player()
  for r in range(9):
      enemy = Enemy()
      enemies.add(enemy)
  
  while True:
  
      pygame.event.pump()
      'main loop'   
      player.move()
      enemy.enmove()
      all_sprites.add(player)
      screen.fill(black)
      all_sprites.draw(screen)
      enemies.draw(screen)
  
      hits = pygame.sprite.spritecollide(player,enemies,False)
      if hits == True:
          player.all_sprites.remove(player)
          print('true')
      all_sprites.update()
  
      pygame.display.update()
      print(hits)
  </code></pre>