[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Background ghosts
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Background ghosts
- From: Weeble <clockworksaint@xxxxxxxxx>
- Date: Fri, 2 Jan 2009 18:43:23 +0000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 02 Jan 2009 13:43:27 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Cw7R1R0Uq7yP2dWhKY7zYVhsvnttOSxgJniK0PjuNZg=; b=P+1jd6xGeyjdYn+MmyRB4pN7v4FdDcOkvXe35kFpfFWpklHI+sJh8eAMXr2sXHsc/G 6czeQ/dIZ9zj+nP9IB6O1M2zYtkFrfNDbibQPKfOqv/T1FjaBCoTHNyOMTu/wMfEVxsp ZwplOJR0mKT+44r6bsIz+uOyg7UYbKwvo7qZo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=AS6onSmac4bYA57wwMzdJoqZlhyQcRzlQOpvUIcoGp/3p3JFnYptrUQlYjGM2K2Nwy MinzHyz9Ntzw71CgxEIaW7jLD4Gs7gSpftu9WUhSwK3kwobw8LukvQde3+CDceFIs1xh KZZt84T3G0kA0v1Ao23+GqGe68br8yzWVGXqw=
- In-reply-to: <20090101140123.13364@xxxxxxxxxxxxxxxxxxxxx>
- References: <20090101140123.13364@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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.