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

Re: [pygame] My first game; the design of pacman



Hi,

On 3/20/06, Ryan Charpentier <ryancharpen@xxxxxxxxx> wrote:
> > [Drawing the Sprites]
>
> The usual way I go about drawing game objects that need to be redrawn every
> frame is to take advantage of the pygame.sprite module. Heres a good
> tutorial on the subject:
> http://kai.vm.bytemark.co.uk/~piman/writing/sprite-tutorial.shtml

Hm, I don't really know how to make the screen global to all
Sprite-Objects, so that they can draw on it. If i put all the code
in one file, then it's ok. But I wanted to split the classes into
several files. Seems that I have to pass the screen-object to
each sprite-class. :-/ (You see, I'm new to python too.)


>  > I'm a bit confused whether there should be a
> > "Master class" which controls everything or if
> > every object should take care only about itself.
>
> Theres pros and cons for each of the two approaches. When you have each
> object take care of itself that means that each object will need to be aware
> of all the other game objects, and it will also need to manipulate them.

Ok, that's not good IMHO.
I will try it with a master-class controlling the game-objects.


Thanks for you reply.
Kai