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

[pygame] Creating large numbers of sprites in array or other structure



Hi,

I'm fairly new to pygame, certainly haven't used it much, and up until now have been creating sprites by defining an extension to the sprite class and then instantiating each sprite by assigning it as, for example:

newsprite = NewSprite(250,250)

...with the arguments that the init method uses in brackets.

If I want to create, say, 150 sprites, and simply add each one to a group rather than having to have a distinct reference for each one, how do I do it? I can't seem to find an example online and I've not had much luck adding them to an array.

Thanks in advance,

Ben Collier