optimize line drawing

This commit is contained in:
Pavel 2020-09-29 12:41:18 +02:00
parent 4d63c812a2
commit 728b83ad37
1 changed files with 3 additions and 2 deletions

View File

@ -153,6 +153,7 @@ def tourner(a):
def avancer(l, color):
global state
start = state[0:2]
t = fix_angle(state[2])
dx, dy = cos(t), sin(t)
state[7] += l
@ -169,11 +170,11 @@ def avancer(l, color):
t = dx <= 0 or int(x) < laby_w - 1 or int(y) < laby_h - 1
if t and tx or ty or (drx and dry and (t and tx or ty)) or (drx and dry and (t and vw(iy, laby_w - 2 - min(ix, ix - drx)) or hw(min(iy, iy - dry), laby_w - 1 - ix))):
state[5] += 15
return
break
l -= .25
state[6] += (state[6] < 200)
state[0:2] = (x, y)
draw_line(state[3] * zx, state[4] * zy, state[0] * zx, state[1] * zy, color)
draw_line(start[0] * zx, start[1] * zy, state[0] * zx, state[1] * zy, color)
def aller_selon(path):
global state