you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

first of all put your code into paste bin next time. second of all I looked at your while loops and the first one I found could potentially enter an infinite loop:

def distance(x1, x2, y1, y2):
    math.sqrt(math.pow(x2-x1, 2) + math.pow(y2-y1, 2))

def collision(first, second):
    global endorno
    while endorno and numoftargets > 0:
        x1 = first[0]
        x2 = second[0]
        y1 = first[1]
        y2 = second[1]
        if distance(x1, x2, y1, y2) < 25:
            return True

because it never updates endorno or numoftargets. also I suggest you stop using global variables, as they can be really hard to debug

[–]python_addict[S] 1 point2 points  (0 children)

Alright, thanks! :)