[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Weird Error



This is not strictly a pygame question, sorry.
I have the following code:

radius = 0
speed = 0.1
asteroidlocation = [self.pos[0],self.pos[1]]
for iterator in xrange(12):
    angle = random.random()*360.0
    PosB = [(radius*cos(radians(angle))),(radius*sin(radians(angle)))]
    PosB[0] += asteroidlocation[0]
    PosB[1] += asteroidlocation[1]
    Speed = [speed*cos(radians(angle)),speed*sin(radians(angle))]
    Bullets.append([PosB,Speed,0])

It gets stuck forever in the loop, which is weird, but even more weird is that it only does so when asteroidlocation is set the way it is.  If it is set as [1,1], for instance, the code runs fine.  This particular code is a function in a class.  I have no idea what is going on...
--
There are 10 kinds of people;
those who understand binary and those who don't.
Without order nothing can exist - without chaos nothing can evolve.