def wallcheck(a):
    """
    checks for collision with walls returns flags if collision occurs with any wall

    ox is 1 if right and -1 if collision with left wall
    oy is 1 if top and -1 if collision with bottom wall
    """
    if a.x + a.r >= 340:
        ox = 1
    elif a.x - a.r <= -340:
        ox = -1
    else:
        ox = 0
    if a.y + a.r >= 303:
        oy = 1
    elif a.y - a.r <= -303:
        oy = -1
    else:
        oy = 0
    return [ox,oy]