[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] collidelist Problem, indices
Hi again, next problem i do not understand
i am using this line:
rectlist=self.dogfighter.draw(self.window)
in this dogfighter object are 2 dogfighters, the same dogfighters as in an array
called dgl
the lines:
self.i=self.ground_r.collidelist(rectlist)
if self.i >= 0:
self.dgl[self.i].explode()
are working perfectly
but
self.i=self.house_r.collidelist(rectlist)
if self.i >= 0:
self.dgl[self.i].explode()
gets me an "IndexError: list index out of range" for one dogfighter
and for the other dogfighter, both dogfighters are exploding
I think the problem is, that i cannot know that the indicies in dgl and
collidelist are the same, but cause a RenderUpdates object is unindexable, i do
not know how to use this function in the right way?