[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] sprite engine
This is a great optimization when it can be used. It requires that you
have sprites not moving/updating on every frame.
That's true - all these dirty rectangle techniques are useless on games
where the entire background moves every frame.
> This can also only be used when sprites are not overlapping.
Uh, not so! If I have a background, then a tree, then a ghost in front
of the tree that's translucent, and something about the tree changes...
i dirty only the tree. The 'go through sprites in zorder and draw if it
intersects the dirty rectangle' bit in the main render loop is what
draws the background, tree, AND ghost, though only the tree got 'dirty.'
--Cindy