> I've tested the game but the bullets aren't getting deleted, they
> linger through all the scenes.

yeah i wasn't going for being super fix-it, just finding and fixing
your problem so you can figure out how you want it fixed.

> Also, I seem to be missing the point of
> "bullets = []".

the way you were using the global bullets list was confusing to me.
Basically i couldn't tell if you were declaring the global first
somewhere. Heres an example, you can pull up a python interpretor

class A(object):
    global s

    def greet(self):
        print s

    def reset(self):
        s = 'reset'


>>> a = A()
>>> a.greet()
Name Error: global name 's' not defined
' ok so now lets set it in globals '
>>> s = 'Bonjour Mary!'
>>> a.greet()
Bonjour Mary!
' ok so lets see if our reset function works '
>>> a.reset()
>>> a.greet()
Bonjour Mary!

Nope, this is b/c theirs some weird clashing going on that i dont
fully understand. It can be alleviated by declaring global s in every
function like so
class A(object):
    def greet(self):
        global s
        print s
    def reset(self):
        global s
        s = 'reset'

which i think is kind of ugly, or you can declare an object in your
Bullet module that you import everywhere. In your bullet module,
anything you initialize in their will be accessible to anything in
your source module. Think of it like this. If you import math, well
now anywhere in your code you can call math.degrees() or whatever. The
same applies for when you import bullet. Now anywhere in your code you
can access bullet.bullets list or whatever you want to initialize.
When you import bullet across multiple files, they will all be working
with the same list.

So the only suggestions i have, you can either try to explicitly
declare global bullets in each function you use it in or you can try
what i suggested and make use of a bullet namespace.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to