title: Making a rect following another rect
body: <p>I'd like an instance of UFO class (let's name it <strong>ufo</strong>) to follow an instance of Ship class  (<strong>ship</strong>). The relevant code is contained in chase_ship method of UFO class.  After running a game, the ufo chase the <strong>ship</strong> for while and then stopped in the place. What's wrong with my method?</p>
  <p>ufo.py</p>
  <pre><code>class UFO():
  ---snip---
      def chase_ship(self):
          &quot;&quot;&quot;Trace and follow a ship.&quot;&quot;&quot;
          if self.rect.x != self.ship.rect.x:
              #Move toward a ship horizontally.
              if self.rect.x &lt; self.ship.rect.x:
                  self.rect.x += self.speed
              else:
                  self.rect.x -= self.speed
          if self.rect.y != self.ship.rect.y:
              #Move toward a ship vertically.
              if self.rect.y &lt; self.ship.rect.y:
                  self.rect.y += self.speed
              else:
                  self.rect.y -= self.speed
              
              
          
          
  
          
  </code></pre>