import pygame pygame.init() class Box(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.image = pygame.Surface((10, 10)) self.rect = self.image.get_rect() b = Box() print "initial b.rect : %s b.rect.center : %s" % (b.rect, b.rect.center) b.rect.inflate_ip(5, 5) print "inflated b.rect : %s b.rect.center : %s\n" % (b.rect, b.rect.center) c = Box() print "initial c.rect : %s c.rect.center : %s" % (c.rect, c.rect.center) c.rect.inflate_ip(-5, -5) print "inflated c.rect : %s c.rect.center : %s" % (c.rect, c.rect.center) # outputs : # # initial b.rect : b.rect.center : (5, 5) # inflated b.rect : b.rect.center : (5, 5) # # initial c.rect : c.rect.center : (5, 5) # inflated c.rect : c.rect.center : (4, 4)