title: Python Crash Course project: Object has no attribute
body: <p>I'm trying to do the project from Python Crash Course and in the middle of the project I'm getting this error and I couldn't figure it out why, I've got alien_invasion.py, settings.py and ship.py files, here they are:</p>
  
  <p>This is main file which is alien_invasion.py</p>
  
  <pre><code>import sys
  import pygame
  from settings import Settings
  from ship import Ship
  
  def run_game():
      pygame.init()
      ai_settings = Settings()
      screen = pygame.display.set_mode((ai_settings.screen_width, 
      ai_settings.screen_height))
      pygame.display.set_caption("Alien Invasion")
  
      ship = Ship(screen)
  
      bg_color = (230, 230, 230)
  
      while True:
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  sys.exit()
  
          screen.fill(ai_settings.bg_color)
          ship.blitme()
  
          pygame.display.flip()
  
  run_game()
  </code></pre>
  
  <p>This is settings.py</p>
  
  <pre><code>class Settings():
  
      def __init__(self):
  
              self.screen_width = 1200
              self.screen_height = 600
              self.bg_color = (230, 230, 230)
  </code></pre>
  
  <p>and this one is ship.py</p>
  
  <pre><code>import pygame
  
  class Ship():
      def __init__(self, screen):
          self.screen = screen
  
          self.image = pygame.image.load('images/ship.bmp')
          self.rect = self.image.get_rect()
          self.screen_rect = screen.get_rect()
  
          self.rect.centerx = self.screen_rect.centerx
          self.rect.bottom = self.screen_rect.bottom
  
          def blitme(self):
              self.screen.blit(self.image, self.rect)
  </code></pre>
  
  <p>AND IT SAYS:</p>
  
  <pre><code>Traceback (most recent call last):
    File "alien_invasion.py", line 26, in &lt;module&gt;
      run_game()
    File "alien_invasion.py", line 22, in run_game
      ship.blitme()
  AttributeError: 'Ship' object has no attribute 'blitme'
  </code></pre>