title: AttributeError: 'pygame.Rect' object has no attribute 'up' and 'down'
body: <p>I'm having an issue where I can't seem to move the character on my screen up and down.</p>
  
  <p>When I run the code and press the down key, I get this error:</p>
  
  <pre><code>AttributeError: 'pygame.Rect' object has no attribute 'down'
  </code></pre>
  
  <p>When I run the code and press the up key, I get this error:</p>
  
  <pre><code>AttributeError: 'pygame.Rect' object has no attribute 'up'
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import pygame
  
  class Character():
  
      def __init__(self, ai_settings, screen):    
          self.screen = screen
          self.ai_settings = ai_settings   
          self.image = pygame.image.load("character.jpg")
          self.rect = self.image.get_rect()
          self.screen_rect = screen.ge_rect()
          self.rect.centerx = self.screen_rect.centerx
          self.rect.centery = self.screen_rect.centery
          self.center = float(self.rect.centerx)
          self.center1 = float(self.rect.centery)
          self.moving_right = False
          self.moving_left = False
          self.moving_up = False
          self.moving_down = False
  
      def update(self):
          if self.moving_right and self.rect.right &lt; self.screen_rect.right:
              self.center += self.ai_settings.char_speed_factor
          if self.moving_left and self.rect.left &gt; 0:
              self.center -= self.ai_settings.char_speed_factor
          if self.moving_up and self.rect.up &lt; self.screen_rect.up:
              self.center1 += self.ai_settings.char_speed_factor
          if self.moving_down and self.rect.down &gt; 0:
              self.center1 -= self.ai_settings.char_speed_factor
          self.rect.centerx = self.center
          self.rect.centery = self.center1
  
      def blitme(self):
          self.screen.blit(self.image, self.rect)
  </code></pre>
  
  <p>This is just the character class python file and not the main file. There is a game functions file which checks for keyboard input and then sets the self.moving variables to True. The definitions in the gamefunctions file are then called in the main file. I am very confused as to why this is happening because I have no trouble with getting the character to move left and right.  </p>