print coordinates in interactive mode

Signed-off-by: Thomas Schmid <tom@lfence.de>
This commit is contained in:
Thomas 2021-07-27 22:43:16 +02:00
parent 43aa5630c9
commit 05af5d85ef

View File

@ -69,15 +69,21 @@ def interactive(an, config):
set_color(an, 0x100) set_color(an, 0x100)
print_pos = lambda x,y: print(f"x:{x} y:{y}")
while True: while True:
if keyboard.is_pressed("w"): if keyboard.is_pressed("w"):
x = x + 1 x = x + 1
print_pos(x,y)
if keyboard.is_pressed("s"): if keyboard.is_pressed("s"):
x = x - 1 x = x - 1
print_pos(x,y)
if keyboard.is_pressed("a"): if keyboard.is_pressed("a"):
y = y - 1 y = y - 1
print_pos(x,y)
if keyboard.is_pressed("d"): if keyboard.is_pressed("d"):
y = y + 1 y = y + 1
print_pos(x,y)
set_pos(an, (x, y)) set_pos(an, (x, y))
time.sleep(0.05) time.sleep(0.05)