[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] sprite module problems



Hi! Check the pygame cvs tree. Pete has fixed a bunch of these problems
allready. Like Group.add taking a list of groups instead of a group
(like this Groupd.add([groupname])) and GroupSingle returning an int
when it's empty. Also, some stuff in the docs are a little off. I also
remember him mentioning something about the "1.2" in the version number.
He said something like "AGHR!!". Good luck with your project. Have a
nice day.

--Adrian

On Thu, 2002-01-03 at 19:55, Mike Benfield wrote:
> Well I think I fixed the problem, although I could be retarded. In
> sprite.py I changed line 130 where it says
> 
> del self.__g[g]
> 
> I changed that to
> 
> del self.__g[group]
> 
> It seems to work now. 
> 
> 
> 
> On Thu, Jan 03, 2002 at 08:20:32PM -0500, Mike Benfield wrote:
> > Python 2.2c1 (#1, Dec 15 2001, 18:25:00) 
> > [GCC 2.95.4 20011006 (Debian prerelease)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > yo
> > >>> import pygame, pygame.sprite, pygame.version
> > >>> pygame.ver
> > '1.2.1'
> > >>> a = pygame.sprite.Sprite()
> > >>> b = pygame.sprite.Group()
> > >>> a.add(b)
> > >>> a.remove(b)
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >     File "/usr/lib/python2.2/site-packages/pygame/sprite.py", line 129,
> >     in remove
> >         _spritegroup = 1 #dummy val to identify groupsnly sprite in
> > 	UnboundLocalError: local variable 'g' referenced before
> > 	assignment
> > 	
> > 
> > my first efforts using the sprite module. I could be doing something
> > wrong but I've tried lots of various crap and it appears to be
> > impossible to remove a sprite from a group. Any help would be
> > appreciated.
> > 
> > Also, this is actually Pygame version 1.3... at least the filename of
> > the .tar.gz said it was 1.3, but the version.py file still says 1.2.1.
> > ____________________________________
> > pygame mailing list
> > pygame-users@seul.org
> > http://pygame.seul.org
> > 
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org