Debugging: Programm reagiert wieder richtig auf Rotation
This commit is contained in:
parent
237a13924b
commit
6abdcc293f
@ -45,7 +45,9 @@ def command_spin():
|
|||||||
print(f"Spin me... {used_direction}!")
|
print(f"Spin me... {used_direction}!")
|
||||||
rotate.value = 0 # damit jede Runde wieder bei Null anfängt, Werte würden allgemein vom -1 bis 1 reichen
|
rotate.value = 0 # damit jede Runde wieder bei Null anfängt, Werte würden allgemein vom -1 bis 1 reichen
|
||||||
result = rotate.wait_for_rotate(timeout=10)
|
result = rotate.wait_for_rotate(timeout=10)
|
||||||
if result > 0 and used_direction == "clockwise" or result < 0 and used_direction == "counter-clockwise":
|
print(rotate.value)
|
||||||
|
print(result)
|
||||||
|
if result and rotate.value > 0 and used_direction == "clockwise" or result and rotate.value < 0 and used_direction == "counter-clockwise":
|
||||||
print(success_message())
|
print(success_message())
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
@ -65,7 +67,7 @@ def main():
|
|||||||
print("Every correct action will give you a point.")
|
print("Every correct action will give you a point.")
|
||||||
print("How many can you get?")
|
print("How many can you get?")
|
||||||
print("Let's go!")
|
print("Let's go!")
|
||||||
list_command_choices =[command_tilt, command_spin, command_blind, command_scream]
|
list_command_choices =[command_spin] #command_tilt, command_spin, command_blind, command_scream]
|
||||||
while result != -1:
|
while result != -1:
|
||||||
score += result # war zuerst ein paar Zeilen weiter unten, hat dann aber nach einer falschen Runde den Score erhöht
|
score += result # war zuerst ein paar Zeilen weiter unten, hat dann aber nach einer falschen Runde den Score erhöht
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user