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

[pygame] Questions about IDE and inflate()



Hi again!

My students like Python, but they did not start with pygame yet, that will come after the summer break. Unfortunately we can not use Eclipse with Pydev since we do not have rights to run programs through the cmd. IDLE is OK, but we would like to find an IDE similar to Eclipse. Does anyone know of a good and free Python-IDE that doesn't depend on being able to run programs through the cmd?

How to use rect.inflate() so that the corresponding sprite still is centered over the rect? Please see the attached picture and hopefully you will understand what I mean. (I modified the plane game from the book "Game Programming" by A Harris - 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()


Salutas,
Hokan


--------------------- From: "Hokan LUNDBERG" <hokan@xxxxxxxx>
To: <pygame-users@xxxxxxxx>
Sent: den 5 maj 2010 21:21
Subject: What would you recommend?


Hi!

I'm teaching programming in a gymnasium (18-19 years old students) and I've
used Java for some years but I would like to use Python and Pygame also.

Which games would you recommend to show to my students so they will be
impressed with the capabilities of Pygame?

Which games would you recommend to start with for looking into the code and
changing / playing with it?

Which Pygame tutorial(s) would you recommend to use?

Many thanks in advance,
Hokan (Stockholm)


Attachment: inflate-test.gif
Description: GIF image