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

[pygame] RenderClear and groups



I'm trying to make a group of RenderClear sprites so I can dynamically
create and destroy the little buggers based on ini files and
whatnot...

Anyhoo, I have my Actor class which extends Sprite, just the normal
Sprite, but then I'm doing something like this...

testsheep = Actor('sheep.ini', (64,64))
 
Test = pygame.sprite.RenderClear(testsheep)

...mainly because I saw some other code that did it this way.  I tried
making a...

rendergroup = pygame.sprite.Group()

... and then...

rendergroup.add(Test)

... type thing, but then when I called draw() and clear(), my game
crashed and IDLE told me that Actor class had no attribute draw()

I'm a bit confused as to how to use Sprite Groups and Renderclear
together...  should it instead be...

rendergroup = pygame.sprite.RenderClear()
rendergroup.add(Test)

...or something like that?


Thanks ahead of time,

Andrew U Baker