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

Re: [pygame] pygame.sprite.RenderUpdates() without arguments



On Tue, Dec 16, 2008 at 11:38:34PM +0100, Gonzalo Castro wrote:
> Hi everybody!
> 
> What does  pygame.sprite.RenderUpdates()  with no arguments?

pygame.sprite.RenderUpdates() is a kind of group.

> class Game:
> 
>     def __init__(self, screen):
> 
>         self.screen = screen
> 
>         self.all = pygame.sprite.RenderUpdates()

This creates a RenderUpdates group named .all

>         Player.containers = self.all
>         Computer.containers = self.all
>         Ball.containers = self.all

This makes three aliases for .all

Somewhere else in the code, sprites will be added to these containers.


---
James Paige