[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Questions about IDE and inflate()



Hi, Hokan.

Try DrPython for editing and running. I've tried many and I keep coming back to this one. It does not run via cmd. Hope it works for you. You'll also need wxPython.

I suspect pygame.Rect.inflate() won't do what you want. Why do you want the rect to be smaller than the cloud image; what are you trying to accomplish?

Gumm

On Tue, Jun 15, 2010 at 1:33 PM, Hokan LUNDBERG <hokan@xxxxxxxx> wrote:
Hi again!

http://www.cs.iupui.edu/~aharris/pygame/ch07/. I would like the rects in the cloud-sprites to be smaller than the clouds themself.)

class Cloud(pygame.sprite.Sprite):
  def __init__(self):
      pygame.sprite.Sprite.__init__(self)
      self.image = pygame.image.load("Cloud.gif")
      self.image = self.image.convert()
      self.rect = self.image.get_rect()
      self.rect = self.rect.inflate(-25, -25) # i did this
      self.reset()