Commit ddfe539f authored by Malte Schmitz's avatar Malte Schmitz
Browse files

Fix eye direction

parent 51d9ae5d
......@@ -92,7 +92,7 @@ def draw_eye():
for y in range(8-eye_blink/2, 8):
draw.line(eye_transform_list([(0,y), (7,y)]), fill="black")
def eye_direction(dir):
def eyes_direction(dir):
global eye_look
eye_look = dir
draw_eye()
......@@ -172,8 +172,9 @@ def goto(new_position):
delta = new_position - position
if abs(delta) > 100:
move(delta)
# convert -1500 <= delta <= 1500 to -2 <= eye_direction <= 2
eyes_direction(int(round(delta / 750.0)))
d = min(2, max(-2, int(round(delta / -750.0))))
print(d)
eyes_direction(d)
position = new_position
def move(steps):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment