title: Blitting in new x position Pygame
body: <p>Im writing a basic mouse dodge game and i need to blit little stars to dodge. i made it so that once one star leaves the screen it blits it again at the top> that works but it blits it in the same x position</p>
  
  <p>Here is the update code that moves the star:</p>
  
  <pre><code>def update(self):
      self.mouse_pos = pygame.mouse.get_pos()
      (self.player_r.x, self.player_r.y) = self.mouse_pos
  
      self.star_r.x = ran_x
      self.star_r.y += 2
      if self.star_r.y &gt; 640:
          self.star_r.y = 0
  </code></pre>
  
  <p>Here is where the star gets blitted:</p>
  
  <pre><code>def blitPlayer(self, screen):
      screen.blit(background,(0,0))
      screen.blit(self.player,(self.mouse_pos))
      screen.blit(self.star,(ran_x, self.star_r.y))
  </code></pre>
  
  <p>I define <code>ran_x</code> outside the class at the top like this:</p>
  
  <pre><code>ran_x = random.randint(10,470)
  </code></pre>
  
  <p>What i think is happening is that when i run it ran_x is being defined by one random number and then keeping that number but i want it to change each time the star leaves the screen</p>
  
  <p>Thanks in Advance!!</p>
  
  <p>-ChristianCareaga</p>