title: pygame: self.screen AttributeError: ... no attribute 'screen'
body: <p>I am trying to learn some pygame programming so i found the pivader project which should be a good start to learn python/pygame.
  here the link: <a href="https://github.com/russb78/pivaders/blob/master/pivaders/pivaders.py" rel="nofollow noreferrer">pivaders</a></p>
  
  <p>So I dont want to make the whole game for now. I am just trying to get the Game-Menu done: that means I want the start-screen and after pushing SPACE I want to enter the ingame screen.<br>
  Here my Code</p>
  
  <pre><code>import pygame, random
  
  RES = (800, 600)
  
  class GameState:
      pass
  
  class Game(object):
      def __init__(self):
          pygame.init()
          pygame.font.init()
          self_screen = pygame.display.set_mode([RES[0], RES[1]])
          self.intro_font = pygame.font.Font(
              'data/Orbitracer.ttf', 72)
          self.intro_screen = pygame.image.load(
              '/home/pi/pivaders/data/graphics/start_screen.jpg')
          self.background = pygame.image.load(
              '/home/pi/pivaders/data/graphics/Space-Background.jpg')
          GameState.end_game = False
          GameState.start_screen = True
  
  
      def control(self):
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  GameState.start_screen = False
                  GameState.end_game = True
              if event.type == pygame.KEYDOWN \
              and event.key == pygame.K_ESCAPE:
                  if GameState.start_screen:
                      GameState.start_screen = False
                      GameState.end_game = True
                  else:
                      GameState.start_screen = True
          self.keys = pygame.key.get_pressed()
          if self.keys[pygame.K_SPACE]:
              if GameState.start_screen:
                  GameState.start_screen = False
  
      def splash_screen(self):
          while GameState.start_screen:
              self.screen.blit(self.intro_screen, [0, 0])
              self.screen.blit(self.intro_font.render(
                  "PIVADERS", 1, WHITE), (265, 128))
              self.screen.blit(self.intro_font.render(
                  "PRESS SPACE TO PLAY", 1, WHITE), (284, 191))
              pygame.display.flip()
              self.control()
  
      def refresh_screen(self):
          self.all_sprite_list.draw(self.screen)
          self.screen.blit(self.background, [0, 0])
          self.clock.tick(self.refresh_rate)
  
      def main_loop(self):
          while not GameState.end_game:
              while not GameState.start_screen:
                  self.control()
                  self.refresh_screen()
              self.splash_screen()
          pygame.quit()
  
  if __name__ == '__main__':
      pv = Game()
      pv.main_loop()
  </code></pre>
  
  <p>Now i get this Error:                            </p>
  
  <pre><code>Traceback (most recent call last):                                  
  File "/home/pi/pivaders/MenuTest.py", line 65, in &lt;module&gt;                     
  pv.main_loop()
  File "/home/pi/pivaders/MenuTest.py", line 60, in main_loop
  self.splash_screen()
  File "/home/pi/pivaders/MenuTest.py", line 42, in splash_screen
  self.screen.blit(self.intro_screen, [0, 0])
  AttributeError: 'Game' object has no attribute 'screen' 
  </code></pre>
  
  <p>I found other questions about that Error and the screen / self.screen but i couldnt figure out how to solve my problem by using that new informations.
  I dont know why the AttributeError: pops up here I never used the screen without self..        </p>
  
  <p>I already was here:
  <a href="https://stackoverflow.com/questions/19820344/how-do-i-solve-an-attribute-error">How do I solve an attribute error?</a><br>
  <a href="https://www.daniweb.com/software-development/python/threads/348024/global-name-screen-is-not-definedpygame" rel="nofollow noreferrer">https://www.daniweb.com/software-development/python/threads/348024/global-name-screen-is-not-definedpygame</a></p>