示例#1
0
def safe_coordinate(x, y, robot360):  #xe, ye enemy posititon in arena format
    coordenate = a_point(x, y)
    if robot360 == None:
        return False

    if coordenate._in(robot360, epsilon):
        return False
    return True
示例#2
0
def make_robot_360(robot, env):
    rp = a_point(robot.x, 28 - robot.y)
    rp.snap_to_boundary_of(env, epsilon)
    rp.snap_to_vertices_of(env, epsilon)
    return vis.Visibility_Polygon(rp, env, epsilon)
示例#3
0
def make_robot_cone(robot):
    return create_cone(a_point(robot.x, robot.y), 15, (robot.rot - 90) % 360,
                       40, 15)
示例#4
0
def you_see_me(enemy, vision360):
    enemypt = a_point(enemy.x, enemy.y)
    if enemypt._in(vision360, epsilon):
        return True
示例#5
0
def i_see_you(enemy, vision360, cone):
    enemypt = a_point(enemy.x, enemy.y)
    if enemypt._in(vision360, epsilon) and enemypt._in(cone, epsilon):
        return True