On Jun 9, 7:45 am, dasacc22 <[email protected]> wrote:
> Im not sure what possessed me to fix this but here you go,
>
> http://www.dasa.cc/shipshowdownfix.tar
>
> Basically you were mismanaging the global bullets list. So when you
> thought you were clearing your bullet list you were actually setting
> everything in the list to None and clearing a copy of it. So then the
> game kicks in and finds a bunch of stuff in your bullet list but cant
> seem to set the x attribute for a None object.
>
> To fix, i basically removed all the global bullets from the code, then
> i changed your
> from bullet import *
> to
> import bullet
>
> In your bullet file, i appended a line at the end that reads simply,
>
> bullets = []
>
> Now in any file that you want, when you >>> import bullet
> you can access bullet.bullets, and it will always be the same object.
> This is what I do typically if i need something like this (like a
> shared physics world or sound system access).
>
> Anyway, best of luck

Thank you for the time dasacc22 :)
I've tested the game but the bullets aren't getting deleted, they
linger through all the scenes. Also, I seem to be missing the point of
"bullets = []". I do this before starting the game, right? But I
gather that doing that will set everything to None instead of clearing
the list (as you said above). Then how do I clear a list? I'm sorry, I
don't have much experience with Python. I used Ruby for some time and
lists are a bit different in Python, I can't seem to understand them
completely.

My idea to clear the list is to pop it until it's length is zero. I
know it's crude, but I don't know any other way...
--~--~---------~--~----~------------~-------~--~----~
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