title: Using self.rect.centerx in pygame to move character at random
body: <p>Currently I cannot get the chracater to move with each iteration of the if statement like he should. Every second the character should move 100 pixels but just moves once at the beginning of the cycle. When I include the statement self.rect.centerx = (WIDTH*3/4) the character doesn't move at all from his postion. When I don't include self.rect.centerx = (WIDTH*3/4) the chracter jumps to the other side of the screen. I cannot move my rect statement around much or I will get an error saying rect is not an attribute of TRUMP class. Please advise.  </p>
  
  <pre><code>class TRUMP(pg.sprite.Sprite):
      def __init__(self, game):
      pg.sprite.Sprite.__init__(self)
      self.game = game
      self.current_frame2 = 0
      self.last_update2 = 0
      self.load_images()
      self.update()
      self.image = self.TRUMP_fingers_l
  
      self.rect = self.image.get_rect()
      self.rect.center = (WIDTH *3/4), (589)
      self.rect.centerx = (WIDTH*3/4)
      self.rect.centery = 589
      self.pos = vec((WIDTH/2), (HEIGHT/2))
      self.vel = vec(0, 0)
      self.acc = vec(0, 0)
  
      self.screen = pg.display.set_mode((WIDTH, HEIGHT))
      self.clock = pg.time.Clock()
  
   def update(self):
      now = pg.time.get_ticks()
      if now - self.last_update2 &gt; 1000:
      self.last_update2 = now
      self.current_frame2 = (self.current_frame2 + 1) % len(self.TRUMP_walk_cycle)
      self.image = self.TRUMP_walk_cycle[self.current_frame2]
      self.rect = self.image.get_rect()
      self.rect.centerx = (WIDTH*3/4)
      self.rect.centerx -= 100
      print(self.rect.centerx)
      self.rect.centery = 589
  </code></pre>