I am trying to make code that displays text, goes back to the beginning of the chunk of text and displays something different.
def melee_attack():
melee1 = (''' /| ________________
O|===|* >________________>
\|''')
melee2 = ('''_ _ _ _ /| ________________
_ _ _ O|===|* >________________>
_ _ _ _ \|''')
print(melee1)
time.sleep(1)
sys.stdout.write("\033[F")
sys.stdout.write("\033[F")
sys.stdout.write("\033[F")
print(melee2)
time.sleep(1)
sys.stdout.write("\033[F")
sys.stdout.write("\033[F")
sys.stdout.write("\033[F")
print(melee1)
time.sleep(.8)
This works for animating a bow and shield but for some reason for the sword it prints [?][F instead of going up a line. The other times I used this are just copied and pasted from this so I know I didn't type it differently, it just doesn't work this one time.