title: Mario running across screen too fast in pygame
body: <p>So first of all the code:</p>
  
  <pre><code>import pygame, sys
  from pygame.locals import *
  
  class Person(pygame.sprite.Sprite):      
  
      def __init__(self, screen):
          self.screen = screen
          pygame.sprite.Sprite.__init__(self)
          self.image = pygame.image.load("images/mariowalking0.png")
          self.rect = self.image.get_rect()
          self.rect.center = (320, 220)
          self.poseNumber = 1
      def update(self):
          self.rect.centerx += 1
          if self.rect.centerx &gt; self.screen.get_width():
              self.rect.centerx = 0
          self.poseNumber = (self.poseNumber + 1)
          if self.poseNumber == 2:
              self.poseNumber = 0
          self.image = pygame.image.load("images/mariowalking" + str(self.poseNumber) +".png")
      def main():
          screen = pygame.display.set_mode((640, 480))
          background = pygame.Surface(screen.get_size())
          background.fill((255, 255, 255))
          screen.blit(background, (0, 0))
          boy = Person(screen)
          allSprites = pygame.sprite.Group(boy)
          keepGoing = True
          while keepGoing:
              for event in pygame.event.get():
                  if event.type == pygame.QUIT:
                      keepGoing = False
                      pygame.quit()
              allSprites.clear(screen, background)
              allSprites.update()
              allSprites.draw(screen)
              pygame.display.flip()
      if __name__ == "__main__":
          main()
  </code></pre>
  
  <p>If you want to run the code, the images of the sprites can be found here: <a href="http://imgur.com/a/FgfAd" rel="nofollow">http://imgur.com/a/FgfAd</a></p>
  
  <p>The Mario Sprite runs across the screen at a very fast pace. Even though I said that I am going to increase the value of centerx by 1. Any ideas why this is happening.</p>
  
  <p>BTW I am really new to pygame, so sorry if I am overlooking an obvious fact or something.</p>