add state[6] and state[7] to draw_score

This commit is contained in:
Pavel 2020-09-27 14:32:40 +02:00
parent 0753d62e98
commit 2a5e6fc59d
1 changed files with 3 additions and 3 deletions

View File

@ -127,9 +127,9 @@ def draw_path():
y = 16
canvas.create_text(4 + (i % 12) * 80, screen_h + 4 + y, anchor = NW, text = '(%5.2f, %3.1f)' % path[i], fill = color)
def draw_score(score):
def draw_score(state):
global canvas
canvas.create_text(4, screen_h + 52, anchor = NW, text = 'score: %f' % score, fill = 'black')
canvas.create_text(4, screen_h + 52, anchor = NW, text = 'score: %f (state[6]: %5.1f, state[7]: %5.1f)' % (state[5], state[6], state[7]), fill = 'black')
def fix_angle(a):
return a * 2 * asin(1) / pi
@ -201,7 +201,7 @@ def aller_selon(path):
state[5] += sin(fix_angle(state[7])) - state[6] // 2
draw_help()
draw_path()
draw_score(state[5])
draw_score(state)
aller_selon(path)