title: Why doesn't it like 'self'?
body: <p>From 'for wall in walls' onwards all the 'self' in red underlined?</p>
  
  <pre><code>class Player(object):
      def __init__(self):
          self.rect = pygame.Rect(x,y,16,16)
  
      def move(self, dx, dy):
          if dx != 0:
              self.move_dir(dx, 0)
          if dy != 0:
              self.move_dir(0, dy)
  
      def move_dir(self, dx, dy):
          self.rect.x = self.rect.x + dx
          self.rect.y = self.rect.y + dy
  
   #^it accepts all of this...
   # but none of the following...
  
      for wall in walls:
          if self.rect.colliderect(wall.rect):
              if dx &gt; 0:
                  self.rect.right = wall.rect.left
              if dx &lt; 0:
                  self.rect.left = wall.rect.right
              if dy &gt; 0:
                  self.rect.bottom = wall.rect.top
              if dy &lt; 0:
                  self.rect.top = wall.rect.bottom
  
          for spike in spikes:
              if self.rect.colliderect(spike.rect):
                  self.rect.x = 16
                  self.rect.y = 16
  
          if player.rect.colliderect(portal_rect):
              self.rect.x = 528
              self.rect.y = 144
  
          if player.rect.colliderect(portal_rect1):
              self.rect.x = 176
              self.rect.y = 208
  </code></pre>
  
  <p>unrelated but it also has an issue with portal_rect</p>