headgames.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:panotti 作者: drscotthawley 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号