print coordinates in interactive mode
Signed-off-by: Thomas Schmid <tom@lfence.de>
This commit is contained in:
parent
43aa5630c9
commit
05af5d85ef
6
main.py
6
main.py
@ -69,15 +69,21 @@ def interactive(an, config):
|
||||
|
||||
set_color(an, 0x100)
|
||||
|
||||
print_pos = lambda x,y: print(f"x:{x} y:{y}")
|
||||
|
||||
while True:
|
||||
if keyboard.is_pressed("w"):
|
||||
x = x + 1
|
||||
print_pos(x,y)
|
||||
if keyboard.is_pressed("s"):
|
||||
x = x - 1
|
||||
print_pos(x,y)
|
||||
if keyboard.is_pressed("a"):
|
||||
y = y - 1
|
||||
print_pos(x,y)
|
||||
if keyboard.is_pressed("d"):
|
||||
y = y + 1
|
||||
print_pos(x,y)
|
||||
|
||||
set_pos(an, (x, y))
|
||||
time.sleep(0.05)
|
||||
|
Loading…
Reference in New Issue
Block a user