recipe-502267.py 文件源码

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

项目:code 作者: ActiveState 项目源码 文件源码
def build_graph():
    # Build GUI environment.
    global frame_handle, y, x, start, sec, timer_text, clock_handle
    frame_handle = graph.after(1000 / FRAMES_PER_SEC, update)
    graph.bind('<1>', change)
    graph['background'] = GAME_COLOR
    # Draw environment.
    y = HEIGHT - WALL + BALL_RADIUS + 2
    graph.create_rectangle((0, 0, WALL - BALL_RADIUS, y), fill=FORCE_COLOR)
    graph.create_rectangle((WIDTH - WALL + BALL_RADIUS, 0, WIDTH, y), fill=FORCE_COLOR)
    graph.create_line((0, y, WIDTH, y), fill=FLOOR_COLOR, width=3)
    # Prepare timer data.
    x = (WALL - BALL_RADIUS) / 2
    y = (y + HEIGHT) / 2
    start = time.clock()
    sec = 0
    timer_text = graph.create_text(x, y, text=f_time(TIME_LIMIT))
    clock_handle = graph.after(1000, update_clock)

################################################################################

# ANIMATION LOOP FUNCTIONS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号