title: Pygame Obstacles
body: <p>I am working on a Pygame game. The premise of the game is you must dodge obstacles that start at the bottom of the screen and move upward to create the illusion the player is falling. I already have a player sprite and need help with the obstacle class. When I try to initialize my Obstacle class, I get an error.</p>
  
  <pre><code>class Obstable(pg.sprite.Sprite):
      def __init__(self, color, width):
              pg.sprite.Sprite.__init__(self)
              self.image = pygame.surface([width, 50])
              self.image.fill(black)
              self.rect = self.image.get_rect()
  BLACK = (0,0,0)
  obst1 = Obstacle(BLACK, 100)
  </code></pre>