def draw_bounds(screen,origin,screensize,angles):
n_az = len(angles)
radius = int(screensize[1]*.5)-10
width = int(2)
color = BLUE
x, y, r = origin[0], origin[1], radius
boundary = pygame.gfxdraw.aacircle(screen, x, y, r, color)
#boundary = pygame.draw.circle(screen, color, origin, radius, width)
# draw a bunch of lines
radian_sweep = 2*math.pi / n_az
radian_start = -0.5*radian_sweep
for i in range(n_az): # draw a bunch of bounds
rad = radian_start + i*radian_sweep
startpos = origin
endpos = (int(origin[0]-radius*math.sin(rad)), int(origin[1]+radius*math.cos(rad)))
pygame.draw.line(screen, color, startpos, endpos)
return
评论列表
文章目录