Source

pygame / examples / chimp.py

Diff from to

File examples/chimp.py

         else:
             rotate = pygame.transform.rotate
             self.image = rotate(self.original, self.dizzy)
-        self.rect = self.image.get_rect()
-        self.rect.center = center
+        self.rect = self.image.get_rect(center=center)
 
     def punched(self):
         "this will cause the monkey to start spinning"
     if pygame.font:
         font = pygame.font.Font(None, 36)
         text = font.render("Pummel The Chimp, And Win $$$", 1, (10, 10, 10))
-        textpos = text.get_rect()
-        textpos.centerx = background.get_rect().centerx
+        textpos = text.get_rect(centerx=background.get_width()/2)
         background.blit(text, textpos)
 
 #Display The Background