[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] RenderUpdate changes in pygame 1.7?
Yes, I am subclassing RenderUpdates, but I thought that might muddy
the waters of my previous email. I'll look into it. My own class is a
form of OrderedRenderDirtyUpdates, that draws the sprites in order of
their y-value on the screen.
To do that I have overrides for the following methods (based on a
tutorial I think):
sprites
add
add_internal
remove_internal
draw
If you know of a new 1.7 way to draw sprites based on y-value I would
love to hear it, but my 1.6 method worked quite well.
Luke
On 08/10/05, Rene Dudfield <renesd@xxxxxxxxx> wrote:
> Hey,
>
> yeah there were sprite changes between 1.6 and 1.7. They were
> rewritten in fact.
>
> However they were supposed to be backwards compatible(I think).
>
> I just tried it 1.7.1 with the aliens.py example, and it iterated ok
> over the group. I added to line 305:
>
> for sp in all:
> print sp
>
>
> Can you please test again that it is a RenderUpdates group and not
> something else? You are not subclassing RenderUpdates are you?
>
>
> Cheer.
>
>
> On 10/8/05, Luke Miller <dodgyville@xxxxxxxxx> wrote:
> > Hello!
> >
> > In pygame 1.6, I have a collection of sprites in a RenderUpdate group,
> > and my code looks like this:
> >
> > for i in myCollection:
> > blah
> >
> > Now, in pygame 1.7 I get an error when this code is running.
> > typeerror: iteration over non-sequence
> >
> > From my debugging, I know that at that point in the code,
> > myCollection is a <RenderUpdates(3 sprites)>
> >
> > This code has worked perfectly in the past (on pygame 1.6) and i think
> > the only difference is I'm now running python 2.4 and pygame 1.7.
> >
> > And I don't think anything changed my end between versions of pygame.
> > Was there a change to the internal structure of some of the sprite
> > groups? Is there an easy fix for this?
> >
> > Thanks,
> > Luke
> >
>