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

Re: [pygame] Background ghosts



Michael Phipps:
> Anyway, if someone wants to take a look, the code is attached...

In this line:
    blocksprite = self.makenewblocksprite(group)
You create a new sprite and add it to "group", but you do not remove
the old one. So you end up with a group filled with many sprites. The
reason you don't see these all the time is that you have two different
paths for rendering, one that is used while a block is falling to
redraw a very small section of the screen, and one that is used at the
start and whenever a block hits the bottom. You see the sprites in
group only when you're re-rendering the falling block, and only where
they coincide with the redraw area.